[pygtk] help with two main windows in pygtk

Tony Nelson tonynelson at georgeanelson.com
Tue Feb 26 00:13:18 WST 2008


At 2:23 PM +0530 2/25/08, Prashant Shah wrote:
>I have two gtk main windows each with its own .py file and its own class.
>
>In the first gtk main window there is a gtk button "Open journal". I
>want the second gtk window to open on clicking it.
>
>Since the second main window has its own .py file and it has its own
>class - how do I create the object and show it ?

Make an instance of that class, and do to that instance anything else
needed to initialize the window.


>Also I have a global varaible in the first main window that has the
>database connection details which I am using inside the second main
>window .py file.
>
>When I try import the second file - it says the varaible not defined !!

This is a Python question.  Modules are modular.  Variables defined in one
module are not defined in another module unless that module imports them
from the first module.

    from firstmodule import mydb_detail1, mydb_detail2
-- 
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson at georgeanelson.com>
      '                              <http://www.georgeanelson.com/>


More information about the pygtk mailing list