Apr-02-2020, 12:14 PM
With Python2 I have this little script with an error in the line with "******" stars:
Greetings
Peter
#!/usr/bin/python import wx def quit(): print("Quit\n") app = wx.App() w = wx.Frame(None) menuQuit = wx.Menu("Quit") menuBar = wx.MenuBar() menuBar.Append(menuQuit, "Operations") w.SetMenuBar(menuBar) w.Bind(wx.EVT_MENU, quit, menuQuit) #******This produces an error***** w.Show(True) app.MainLoop()This is the error message:
Error:Traceback (most recent call last):
File "./test.py", line 14, in <module>
w.Bind(wx.EVT_MENU, quit, menuQuit) #******This produces an error*****
File "/home/peter/.local/lib/python2.7/site-packages/wx/core.py", line 1403, in _EvtHandler_Bind
assert source is None or hasattr(source, 'GetId')
What am I doing wrong?Greetings
Peter