[pygtk] Refresh window

Gustavo J. A. M. Carneiro gjc at inescporto.pt
Thu Dec 1 19:56:58 WST 2005


On Wed, 2005-11-30 at 11:31 -0500, Genie Fomina wrote:
> Hello All,
> 
> This is my first pygtk program and I know I am missing something
> simple but can't find what is the right way to do this: 
> I have three open sockets added by io_add_watch. When I have
> 
> while gtk.events_pending():
>     gtk.main_iteration()
> 
> at the end of my IO callbacks some IO events got missed or happen far
> later then they should. If I put just
> 
> if gtk.events_pending():
>     gtk.main_iteration()
> 
> it works better but still no stable results. In pygtk faq I found
> "Note that running a mainiteration inside an idle, io (input_add) or
> timeout handler is generally considered `a bad idea' because it
> doesn't work very well." So what is the right way to do it? Do I have
> to use threads?

  See [1] and [2] ([2] now ships in Kiwi2).

 [1] http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq23.020.htp
 [2] http://www.gnome.org/~gjc/gtasklet/html/

  Regards.

-- 
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic



More information about the pygtk mailing list