Is there a way I can bind a function with parameter to menu items in 'for loop'?
for idx, val in enumerate(files):
self.Bind(wx.EVT_MENU, lambda event: self.loadFile(val), id=100+idx)
The above code always passes the last 'val' of the loop to the function for all binds.