I'm messing around with wxGlade for some instant gratification, but I simply
can't figure out how to add events to my app. For instance, I'd like to add a
simple menu-event to gracefully close down the app, but no matter where I put
the EVT_MENU, the interpreter bitches about an invalid syntax. No matter what I
do to correct the syntax, I get the same error message. I've tried to put in in
__set_properties() and __do_layout(), but nothing helped.
Score some karma and help out a newbie, will ya'?!
···
#-------------------------------------------------------------
#!/usr/bin/env python
# generated by wxGlade 0.2.1 on Tue Apr 15 13:17:17 2003
from wxPython.wx import *
class MyFrame(wxFrame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = wxDEFAULT_FRAME_STYLE
wxFrame.__init__(self, *args, **kwds)
# Menu Bar
self.frame_1_menubar = wxMenuBar()
self.SetMenuBar(self.frame_1_menubar)
wxglade_tmp_menu = wxMenu()
wxglade_tmp_menu.Append(ID_EXIT, "Exit", "Blow This Popstand!")
self.frame_1_menubar.Append(wxglade_tmp_menu, "File")
# This is the problem generating an invalid syntax. WHY?!
EVT_MENU(self, ID_EXIT, self.OnExit)
# Menu Bar end
self.__set_properties()
self.__do_layout()
# end wxGlade
def OnExit(self, event):
self.Close(true)
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("frame_1")
# end wxGlade
def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_1 = wxBoxSizer(wxVERTICAL)
self.SetAutoLayout(1)
self.SetSizer(sizer_1)
sizer_1.Fit(self)
sizer_1.SetSizeHints(self)
self.Layout()
# end wxGlade
# end of class MyFrame
--
"Thinking gives you wrinkles!"
Malibu Stacy, the Simpsons