while/if gtk.events_pending():
gtk.main_iteration()
Another quesion, is there a way to call a callback to write into a socket only when I have data to write? Do I have to use io_add_watch method to write into a socket or it will be better without it?
Thank you, Genie
On 12/1/05, John Ehresman <[EMAIL PROTECTED]
> wrote:
Genie Fomina wrote:
> Gustavo, thank you for your reply, that looks promising. But it requires
> pygtk 2.8 for some reason. I am not sure I will be able to use this
> version everywhere I will put my application to. There might be 2.6 or
> even 2.4 versions. What is the right way of working with sockets and
> refreshing windows in these versions?
Is your problem reading everything from a socket or doing something else
that requires a fair amount of time? If it is reading from a socket,
structure your program to only read whatever is available in a callback
then return and let the mainloop call you again when there's more to
read. If the problem is doing something else, break the task up into
multiple steps and the schedule an idle or timeout for each one.
John
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
