[pygtk] Pygtk toggle hide show with time interval
pahnin sd
pahninsd at gmail.com
Sat May 7 04:08:38 WST 2011
Hi,
I am very new to pygtk, please don't mind if my question is too simple or
stupid.
I am still learning pygtk and before I ask my doubt here is my code
import gtk, pygtk
pygtk.require('2.0')
import time
class test():
def __init__(self):
self.window=gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect=('delete_event',lambda wid, we: gtk.main_quit())
self.window.show()
print "show"
time.sleep(2)
self.window.hide()
print "hide"
time.sleep(3)
self.window.show()
print "show"
if __name__ == "__main__":
test()
gtk.main()
as I read on web time.sleep should produce an interval, and the above code
should display a window and hide it after 2 seconds
and then display it again after 3 seconds
But for me it doesn't work the same, the windows just appears suddenly after
3 seconds and I can see the output
show
hide
show
So I would like to know where I am doing the mistake,
Regards
phanindra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20110507/95e9ecf1/attachment-0001.html>
More information about the pygtk
mailing list