I have never tried this, but it should work, at least in principle:
def _gui_sleep(time):
gobject.timeout_add(time, gtk.main_quit)
gtk.main()
(This is called a recursive main loop.)
Then call _gui_sleep() below (I inserted such call in your code
below).
A Qui, 2003-09-04 �s 06:14, Gerardo Arnaez escreveu:
> Hello and thank you very much for mentioned the
> timeout_add
>
> I want to have a screen that pops up (splash or
> dialog)
> and counts down for a certain period and then
> dissapears
>
> The follow code is starting to do something of that I
> want but when the splash page pops up it doesnt update
> the range.
>
> Here is the code
> Again all help is very appreciated
>
> #!/usr/bin/python2.2
> import pygtk
> pygtk.require('2.0')
> import gtk
>
>
> class Splash:
> def __init__(self):
> self.window = gtk.Window()
> self.window.set_title("SPLASH")
> self.labelCount = gtk.Label()
> self.labelCount.show()
> self.window.add(self.labelCount)
> gtk.timeout_add(2000, self.window.show)
> for x in range(10000):
> self.labelCount.set_text("%s" %x)
_gtk_sleep(1000)
> gtk.timeout_add(5000, self.window.hide)
>
> class Window:
> def main(self):
> gtk.main()
>
> def __init__(self):
> self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
> self.window.set_title("Pay Raintree")
> self.window.set_border_width(10)
> self.window.show()
>
> #MAIN VERTICAL BOX
> self.VboxMain = gtk.VBox(gtk.FALSE,0)
> self.VboxMain.show()
> self.window.add(self.VboxMain)
> self.window.set_border_width(20)
>
> #First Horizontal Box
> self.Hbox1 = gtk.HBox(gtk.FALSE,0)
> self.Hbox1.show()
> self.VboxMain.pack_start(self.Hbox1)
> #Label
> self.mainLabel = gtk.Label("USER INFO")
> self.mainLabel.show()
> self.Hbox1.pack_start(self.mainLabel,
> gtk.TRUE, gtk.TRUE,0)
>
> #add QUIT BUTTON
> self.quitButton = gtk.Button("QUIT")
> self.quitButton.connect("clicked", self.quit)
> self.quitButton.show()
> self.Hbox1.pack_start(self.quitButton,
> gtk.TRUE, gtk.TRUE,0)
>
> def quit(self,widget, data = None):
> gtk.main_quit()
>
>
>
> window = Window()
> splash = Splash()
>
> #gtk.timeout_add(2000,splash.window.show)
> #gtk.timeout_add(5000, splash.window.hide)
> #Unclear that gtk.idle_add is doing here
> #gtk.idle_add(window.main())
> window.main()
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> _______________________________________________
> pygtk mailing list [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
--
Gustavo Jo�o Alves Marques Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/