RE: Re: [Anygui-users] window.destroy() to terminate application.run() loop

[email protected] (Dallas Johnston) Wed, 19 Mar 2003 00:51:32 -0500
Newsgroups gmane.comp.python.anygui.devel
Message-ID <[email protected]>
Not exactly related, but just a reminder that to exit 
the application, one can call the app.quit() method.

>> # --- Cut here ---
>> from anygui import *
>> 
>> app = Application()
>> 
>> g_y = 150
>> 
>> win = Window(width = 110, height = 210)
>> app.add(win)
>> 
>> # depending on anygui version change handler def.
>> # cvs handler def, I guess 0.2a api?
>> def my_quit(event):
>> # 0.1.1 handler def
>> #def my_quit(**kw):
>>     print "Hello, world!"
>>     win.destroy()
>> 
>> opt = Options(x = 30, width = 50, height = 30)
>> btn = Button(opt, y = 30, text = "Quit")
>> link(btn, 'click', my_quit)
>> 
>> win.add(btn)
>> 
>> app.run()


__________________________________________________________________
Try AOL and get 1045 hours FREE for 45 days!
http://free.aol.com/tryaolfree/index.adp?375380

Get AOL Instant Messenger 5.1 for FREE! Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promos=380455


-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink? 
You could win a Tablet PC. Get a free Tablet PC hat just for playing. 
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en