[Patches] [ python-Patches-989712 ] Support using Tk without a mainloop

SourceForge.net noreply at sourceforge.net
Wed Jul 14 22:44:04 CEST 2004


Patches item #989712, was opened at 2004-07-12 15:16
Message generated for change (Comment added) made by kbk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=989712&group_id=5470

Category: IDLE
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Noam Raphael (noamr)
>Assigned to: Kurt B. Kaiser (kbk)
Summary: Support using Tk without a mainloop

Initial Comment:
In the regular python shell, you can open Tk windows,
and they will operate even though you didn't call
Tkinter.mainloop(). This is useful, for example, when
you manipulate matplotlib graphs from within the python
shell.
This is done by a hook, installed when a tkapp object
is being initialized, which handles Tk events while the
shell is waiting for user input.

I imitated this behaviour in IDLE: When the subprocess
is idle, it checks whether Tkinter._default_root is set
(this happens when the Tkinter.Tk class, which makes a
tkapp object, is initialized, unless
Tkinter._use_default_root is False), and if so, handles
Tk events.

For me it works very well.

Have a good day,
Noam Raphael

----------------------------------------------------------------------

>Comment By: Kurt B. Kaiser (kbk)
Date: 2004-07-14 15:44

Message:
Logged In: YES 
user_id=149084

Can you give me some more information on the hook in the
Python interpreter?  Where is it in the code?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=989712&group_id=5470


More information about the Patches mailing list