Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22411

Tkinter: IDLE can't get out of mainloop

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <anthra.norell@bluewin.ch>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:IDLE': 0.05; 'def': 0.06; 'own.': 0.07; 'suppose': 0.07; 'tkinter': 0.07; 'ubuntu': 0.07; 'x-mailer:evolution 2.28.3': 0.07; 'python': 0.09; 'bindings': 0.09; 'responding': 0.09; 'tracing': 0.09; 'do,': 0.14; 'idle.': 0.16; 'nest': 0.16; 'print': 0.21; 'all,': 0.21; 'install': 0.21; 'back.': 0.21; 'work.': 0.21; 'tried': 0.23; 'idea': 0.24; 'run': 0.25; "doesn't": 0.25; 'looks': 0.25; '2.6': 0.27; 'skip:( 20': 0.28; 'protocol.': 0.28; 'running.': 0.28; 'source': 0.29; "skip:' 10": 0.29; 'compiled': 0.30; 'says': 0.31; 'itself': 0.31; 'suggestion': 0.31; 'code': 0.32; 'problems': 0.34; 'to:addr:python-list': 0.35; 'things': 0.35; 'there': 0.36; 'doing': 0.36; 'bad': 0.36; 'starting': 0.36; 'but': 0.37; 'subject:: ': 0.37; 'unable': 0.38; 'received:192': 0.39; 'to:addr:python.org': 0.39; 'received:192.168': 0.40; 'received:192.168.1': 0.40; 'back': 0.63; 'stay': 0.63; 'time?': 0.65; 'received:ch': 0.70; 'prompt': 0.78; 'subject:get': 0.82; 'from:addr:bluewin.ch': 0.84; 'killing': 0.84
Subject Tkinter: IDLE can't get out of mainloop
From Frederic Rentsch <anthra.norell@bluewin.ch>
To python-list@python.org
Content-Type text/plain; charset="UTF-8"
Date Sat, 31 Mar 2012 09:42:59 +0200
Mime-Version 1.0
X-Mailer Evolution 2.28.3
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1172.1333179854.3037.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1333179854 news.xs4all.nl 6957 [2001:888:2000:d::a6]:38498
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:22411

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Tkinter: IDLE can't get out of mainloop Frederic Rentsch <anthra.norell@bluewin.ch> - 2012-03-31 09:42 +0200

csiph-web