ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxPython-users
wxPython-users
[wxPython-users] wxGlade and Events. HOW?!
by Eladio Ventura other posts by this author
Apr 15 2003 1:23PM messages near this date
Re: [wxPython-users] Symbol Peek__13wxInputStream: referenced symbol not found. | Re: [wxPython-users] Question re right-aligned text control
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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@[...].org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Thread:
Eladio Ventura
Frank Millman
Chris Munchenberg
Eladio Ventura
Eladio Ventura
Robin Dunn
Chris Munchenberg
Eladio Ventura
Chris Munchenberg
Eladio Ventura
Eladio Ventura
Alberto Griggio
Frank Millman
Robin Dunn

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved