[pygtk] Splash for app

shakaran shakaran at gmail.com
Mon May 19 16:25:18 WST 2008


Hello, I'm starting with python and I am amazed with its potential.

I'm trying to make an application with PyGtk and I need a splash.
Googling I found very little information about it, only a couple of
blogs explaining well above with wxwidget and Gtk
pure.

With lines Gtk I fought and I managed to do something like this
:

---

#! / usr / bin / env python
# -*- Coding: UTF-8 -*-

Import pygtk
pygtk.require ('2 .0 ')
Import GTK
Import GObject

Splash Class:
     def start (self):
         print "Creating SPLASH ..."
         self.v = gtk.Window (gtk.WINDOW_TOPLEVEL)
         self.v.set_position (gtk.WIN_POS_CENTER)
         self.v.set_modal (True)
         self.v.set_size_request (150.100)
         self.v.set_title ( 'MiAplicación')
         self.v.AppPaintable = True

         image = gtk.Image ()
         image.set_from_file ( "logo.gif")

         gtk.VBox box = ()
         box.pack_start (text, false, false, 0)
         self.v.add (box)
         image.show ()
         box.show ()

         gtk.Label label = ( "MyApp 0.0.0.1")
         box.pack_start (label, True, False, 0)
         label.show ()

         self.v.show ()
         self.timeout = gobject.timeout_add (5000, self.AutoClose)

         # MiAplicacion ()
         # self.AutoClose ()

     def AutoClose (self):
         self.v.destroy ()
         False Return

MiAplicacion Class:

     def __init__ (self):
         gtk.Window window = (gtk.WINDOW_TOPLEVEL)

         Many operations #
         Cargo # BD
         # Load interfaces
         # Etc.
         # To simulate that, nothing like a big loop of 10 million
         print "Starting loop"
         i = 1
         while i <10000000:
             i = +1

         print "Loop finished"
         window.show ()



def main ():
     gtk.main ()


if __name__ == "__main__":
     print "Loading GUI ..."
     Splash s = (). start ()
     print "Loading application"
     Miaplicacion ()
     Main ()

---

The problem is that the splash is released, but only when everything
is loaded
the application process, hence, not
makes its main objective, which is to remain until the implementation
is
load.
The code I tried to throw the kind of application from within the
splash and closing with a timeout or
when the class of the application is completed loading.

It must be something very simple wrong but I can not see. Nor do I
references in any application of open source
This programmed with PyGtk and use a Splash, so I could not watch
and learn anything from it.

Another problem I have is not as remove all other parts of the
Window (title, and buttons to maximize, minimize and close)
Splash window.

Any comment is welcome.

Greetings.


--
Shakaran
My online role-playing game: www.apogeus.es


More information about the pygtk mailing list