[pygtk] Window waits to complete code brfore show

Volker Helm Helm.volker at gmx.de
Tue Feb 27 22:38:07 WST 2007


Hi Miki,

just put the gtk code into a class as seen here:
http://www.pygtk.org/pygtk2tutorial/ch-GettingStarted.html#sec-HelloWorld

put the rest of the code into another class or function, so you can call it from the first gtk class.

Then it will show first the window with the label, after it you call 

...
import pygtk
...
class gtkping(object):
    def delete_event(self, widget, event, data=None):
        return False

    def __init__(self):
        w = gtk.Window()
        w.connect("delete_event", self.delete_event)
        l = gtk.Label("pppp")
        w.add(l)
        w.show_all()
        #now you can call your ping functions

    def main(self):
        gtk.main()

def ping...


if __name__ == "__main__":
   test = gtkping()
   test.main()

-- 
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out


More information about the pygtk mailing list