[Tkinter-discuss] Persuading after_idle callback to only get called when the window is mapped

Peter Milliken peter.milliken at gmail.com
Tue Jan 12 23:19:38 CET 2010


Actually it is nolonger a "bad" idea to access tk objects from two or more
threads, download the package mtTkinter - someone (I forget who) very kindly
provided this package that allows more than one thread to access GUI objects
- since loading it I abolished all threading problems in my GUI applications
(I used the threading and multiprocessing packages quite frequently in my
GUI applications) - it used to be a chore to ensure that only one thread
could access the GUI elements but this package removes that restriction -
all for the price of a single "import" statement!

Peter

On Wed, Jan 13, 2010 at 8:14 AM, Michael Lange <klappnase at web.de> wrote:

> Hi Geoff,
>
> (...)
> >
> > I have got something that seems to work now, which is to create a
> > thread, call wait_visibility in it
> > and then add the idle handler, and then call update_idletasks at the
> > beginning of the idle
> > handler. Feels to me like all that fuss shouldn't really be necessary,
> > but there we are. If anyone
> > knows of a simpler way I'd be interested to hear what it is.
>
> This sounds like you are trying to access tk from within two different
> threads which is generally a bad idea, though it may *seem* to work
> sometimes.
> Maybe we can provide better help if you could post a short code snippet
> that demonstrates your problem.
>
> Regards
>
> Michael
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20100113/410d0006/attachment.htm>


More information about the Tkinter-discuss mailing list