I have a query. I have two modules viz. MnSem5Main.py and MnCEMMain.py in
different folders.
I have created the below instances in MnSem5Main.py:
'app' , 'frame'
Please note 'app' instance created using wx.App and 'frame' using wx.Frame
built in classes.
I want to access these in MnCEMMain.py. How to access these instances?
Well, you can pass in references to the app and frame objects to MnCEMMain.py and do it that way. Or you could us PubSub, which is my preferred method. It’s in wx.lib.pubsub. There are various examples on the wxPython wiki and on my blog.
Note that pubsub in wx.lib of wxPython 2.8, though it works well, is not as powerful as the new version, which can be downloaded separately from pubsub.sf.net and installed standalone (or within wx.lib to replace wx.lib.pubsub, both methods work). Robin has started process of upgrading wx.lib.pubsub to newest.
I have a query. I have two modules viz. MnSem5Main.py and MnCEMMain.py in
different folders.
I have created the below instances in MnSem5Main.py:
‘app’ , ‘frame’
Please note ‘app’ instance created using wx.App and ‘frame’ using wx.Frame
built in classes.
I want to access these in MnCEMMain.py. How to access these instances?
Regards,
Sachindeo V Chavan
Well, you can pass in references to the app and frame objects to MnCEMMain.py and do it that way. Or you could us PubSub, which is my preferred method. It’s in wx.lib.pubsub. There are various examples on the wxPython wiki and on my blog.