James Henstridge wrote:
Don't sleep :)
When you call sleep(), the whole process sleeps and you starve the
event loop. If you want to do something 10 seconds later, set a
timeout with gtk.timeout_add() (the timeout is in milliseconds, so you
would pass 10000 as the timeout) and return from your handler.
Something like this:
def my_handler():
print "Timeout called
return False
...
gtk.timeout_add(10000, my_handler)
Your handler will then be called from the event loop after the
timeout. If you return True from your timeout, it will be requeued
with the same delay.
James.
Hi, thanks for your fast answer :-), but
I have not understood very well your answer. I have put function
"sleep(10)" like example. In fact I am executing other operations,
concretely a call to a remote object (omniORB), and the window is not
shows until the operations in the remote system finish. But putting any
operation that late any time, for example a loop:
for i in xrange(0, 50000): print i
The window is not draw until finish the loop. I need show the dialog
window while execute operations:
-----------------
dialog = GtkDialog() # Dialog window with any labels
< operations >
dialog.change_label("step 1 end")
<operations>
dialog.change_label("step 2 end")
etc
-------------------
I want show the steps (severeal operations) in the dialog window
changing the labels of the dialog window.
Can I do that???
Thanks very much.
--
--------------------------------------------------------
Javier Rom�n Espinar <[EMAIL PROTECTED]>
Linux Mobile System 1.0
http://linuxmobile.sf.net
--------------------------------------------------------
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/