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


Groups > comp.lang.python > #56680 > unrolled thread

Process pending Tk events from GObject main loop?

Started bySkip Montanaro <skipm@trdlnk.com>
First post2013-10-11 07:52 -0500
Last post2013-10-11 21:58 +0200
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Process pending Tk events from GObject main loop? Skip Montanaro <skipm@trdlnk.com> - 2013-10-11 07:52 -0500
    Re: Process pending Tk events from GObject main loop? Christian Gollwitzer <auriocus@gmx.de> - 2013-10-11 21:58 +0200

#56680 — Process pending Tk events from GObject main loop?

FromSkip Montanaro <skipm@trdlnk.com>
Date2013-10-11 07:52 -0500
SubjectProcess pending Tk events from GObject main loop?
Message-ID<mailman.1002.1381496349.18130.python-list@python.org>
I know I have things bassackwards, but trying to process Gtk events
from Tkinter's main loop using after() isn't working. (I suspect our
underlying C++ (ab)use of Gtk may require a Gtk main loop). I'd like
to process Tk events periodically from a GObject main loop. I know I
want to call gobject.idle_add(), but can't find Tkinter equivalent to
gobject.MainLoop().get_context().iteration(). That is, how do you
process a single event (or all pending events)? It looks like
_tkinter.dooneevent() might be the right call to process a single
event, but how do I tell no more events are pending?

Thx,

Skip

[toc] | [next] | [standalone]


#56705

FromChristian Gollwitzer <auriocus@gmx.de>
Date2013-10-11 21:58 +0200
Message-ID<l39l96$q86$1@dont-email.me>
In reply to#56680
Am 11.10.13 14:52, schrieb Skip Montanaro:
> I know I have things bassackwards, but trying to process Gtk events
> from Tkinter's main loop using after() isn't working. (I suspect our
> underlying C++ (ab)use of Gtk may require a Gtk main loop). I'd like
> to process Tk events periodically from a GObject main loop. I know I
> want to call gobject.idle_add(), but can't find Tkinter equivalent to
> gobject.MainLoop().get_context().iteration(). That is, how do you
> process a single event (or all pending events)? It looks like
> _tkinter.dooneevent() might be the right call to process a single
> event, but how do I tell no more events are pending?

To process all pending events in Tcl/Tk, you use update (Tcl function). 
So you just grab a Tkinter object and execute its .update() function, or 
you manually invoke something like

	root.tk.eval('update')

Christian

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web