wxGlade
Markus Faltin
marfal at gmx.de
Thu Feb 19 16:11:43 EST 2004
I'm a newbie regarding wxPython, nevertheless I worked this out:
> class MyFrame(wxFrame):
> def __init__(self, *args, **kwds):
> # begin wxGlade: MyFrame.__init__
> kwds["style"] = wxDEFAULT_FRAME_STYLE
> wxFrame.__init__(self, *args, **kwds)
> self.button_1 = wxButton(self, -1, "button_1")
> self.__set_properties()
> self.__do_layout()
> # end wxGlade
> EVT_BUTTON(self, 1003, self.event)
You have to set the identifier of the button:
self.button_1 = wxButton(self, 1003, "button_1")
> def event(self):
> print "ciao"
The triggered method also needs the event as a parameter:
def event(self, event):
print "ciao"
Markus
More information about the Python-list
mailing list