Commit 36f15fb2 authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Lambda within for loop breaks closure, causes wrong func to be invoked

parent 8d931b81
......@@ -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 : func(), item)
self.Bind(wx.EVT_MENU, lambda ev, f=func : f(), item)
# We create the layout menu,
# but don't populate it - this
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment