[pygtk] Layout of complex app

Thomas Guettler hv at tbz-pariv.de
Wed Jan 28 21:02:39 WST 2009


Hi,

what layout (directories and classes) do you use for a
pygtk project? I am programming since several years, but I am not
used to event based programming like pygtk.

The pygtk tutorial suggest this:

{{{
class HelloWorld:
    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        ...
        self.show()

    def main(self):
        gtk.main()

if __name__ == "__main__":
    hello = HelloWorld()
    hello.main()

}}}

If you start other dialogs from "HelloWorld", which depend on data
stored in the main
object, do you pass it around, or do you store it in a "global" variable
at module level?

  Thomas

      


-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de



More information about the pygtk mailing list