[wxPython] popup menu in wxOGL example question

Doh!!

I totally missed that. Thanks to Tim Hochberg and Robin for the lesson in
reading my code...twice for good measure.

Cheers,
Nick

···

-----Original Message-----
From: Robin Dunn [mailto:robind@earthling.net]
Sent: Wednesday, February 28, 2001 3:24 PM
To: wxpython-users@lists.sourceforge.net
Subject: Re: [wxPython] popup menu in wxOGL example question

handlers are not called when I click on a menu item in the popup menu.

(In

fact, I am getting a cryptic TypeError message sent to stdout -

"TypeError:

too many arguments; expected 1, got 2" - no actual exception and no
indication where it occurs.)

Look for something that has only one parameter and should have two.

# event handlers declared in body of MyFrame class
def OnShadowOn(self):
print "OnShadowOn called\n"
# actual code removed for clarity

def OnShadowOff(self):
print "OnShadowOff called\n"
# actual code removed for clarity

Voila! All event handlers are given an event object argument, even if they
don't need to use it. Try this:

def OnShadowOn(self, evt):
     print "OnShadowOn called\n"
     # actual code removed for clarity

def OnShadowOff(self, evt):
     print "OnShadowOff called\n"
     # actual code removed for clarity

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users