Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ying-Qiu Zheng
fsleyes
Commits
36f15fb2
Commit
36f15fb2
authored
Feb 23, 2021
by
Paul McCarthy
🚵
Browse files
BF: Lambda within for loop breaks closure, causes wrong func to be invoked
parent
8d931b81
Changes
1
Hide whitespace changes
Inline
Side-by-side
fsleyes/frame.py
View file @
36f15fb2
...
...
@@ -1812,7 +1812,7 @@ class FSLeyesFrame(wx.Frame):
for
name
,
cls
in
pluginViews
.
items
():
func
=
ft
.
partial
(
self
.
addViewPanel
,
cls
,
title
=
name
)
item
=
menu
.
Append
(
wx
.
ID_ANY
,
name
)
self
.
Bind
(
wx
.
EVT_MENU
,
lambda
ev
:
f
unc
(),
item
)
self
.
Bind
(
wx
.
EVT_MENU
,
lambda
ev
,
f
=
func
:
f
(),
item
)
# We create the layout menu,
# but don't populate it - this
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment