Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Tkinter: IDLE can't get out of mainloop

Reply
Thread Tools

Tkinter: IDLE can't get out of mainloop

 
 
Frederic Rentsch
Guest
Posts: n/a
 
      03-31-2012
Hi all,

Is is a bad idea to develop Tkinter applications in IDLE? I understand
that IDLE is itself a Tkinter application, supposedly in a mainloop and
mainloops apparently don't nest.

I tried to install a root-destroy-protocol:

def destroy_root ():
print 'Destroying root'
root.destroy ()

root.protocol ("WM_DELETE_WINDOW", destroy_root)

I see the tracing message 'Destroying root', but stay stuck unable to
get the IDLE prompt back. Ctr-C doesn't work. The only way out I know is
killing IDLE. When I do, a warning says that a program is still running.
That must be IDLE's own WM_DELETE_WINDOW protocol. Is there a way to get
the prompt back without killing IDLE? Is there a way to nest a
mainloop?
Up to now I have been able to get by without a mainloop. I suppose
this is because I have only been doing layouts. Starting now to do
events I observe what in the absence of a mainloop looks like
synchronization problems with bindings responding to other events than
their own.
If I run from a terminal things seem to work out. Is it standard
development practice to run code from a terminals ($ python program.py)?
What's the 'program.pyc' for if the source is compiled every time?
I use Python 2.6 on Ubuntu 10.04 LTS.

Thankful for any suggestion

Frederic


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wxPython MainLoop exception handling problem Kreedz Python 2 09-12-2005 06:56 PM
detect tk mainloop John Hunter Python 0 01-26-2005 03:32 PM
Problem with tkinter mainloop k2riddim Python 2 11-30-2004 02:30 PM
Re: Tk mainloop() dan Python 0 07-20-2003 02:32 PM
Re: Tk mainloop() John Roth Python 0 07-20-2003 11:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57