So I have taken testNotebook.py and added some stuff. in one of the child windows, I have: def on_initialize(self, event): self.parent=self.getParent() as mentioned in Python24/Lib/site-packages/PythonCard/docs/html/walkthrough3.html this is what I get: File "C:\Python24\Lib\site-packages\InstrumentThing\testNotebook\CameraLinkTerminal.py", line 41, in on_initialize self.parent=self.getParent() AttributeError: 'CameraLinkTerminal' object has no attribute 'getParent' I also tried: self.parent=self.wx.Frame.GetParent() and got: AttributeError: 'CameraLinkTerminal' object has no attribute 'wx' I just need to get some variables from the parent, or if nothing else read the pages name. Thanks, Cullen -- |Cullen Newsom SUS Optics| |10905 Cash Road Stafford, Texas 77477| |cn...@sa... tel: 281.276.3737|
Can you post all of you code please? www.rafb.net/paste Cullen Newsom wrote: > So I have taken testNotebook.py and added some stuff. in one of the > child windows, I have: > def on_initialize(self, event): > self.parent=self.getParent() > > as mentioned in > Python24/Lib/site-packages/PythonCard/docs/html/walkthrough3.html > this is what I get: > File > "C:\Python24\Lib\site-packages\InstrumentThing\testNotebook\CameraLinkTerminal.py", > line 41, in on_initialize > self.parent=self.getParent() > AttributeError: 'CameraLinkTerminal' object has no attribute 'getParent' > > I also tried: > self.parent=self.wx.Frame.GetParent() > and got: > AttributeError: 'CameraLinkTerminal' object has no attribute 'wx' > > I just need to get some variables from the parent, or if nothing else > read the pages name. > > Thanks, > Cullen > >
I'll try to answer your question, though you never bothered to comment on my suggested "solution" to your earlier request concerning multilingual GUIs. Cullen Newsom wrote: > So I have taken testNotebook.py and added some stuff. in one of the > child windows, I have: > def on_initialize(self, event): > self.parent=self.getParent() > > as mentioned in > Python24/Lib/site-packages/PythonCard/docs/html/walkthrough3.html > this is what I get: > I doubt walkthrough3 has got nothing to do with tabsheets, though the term childwindow appears in tabsheet terminology also. I had the same problem also. After a considerable number of hours wandering in total darkness I found the way that seems to work for me at least. In the initalizers for the individual tabsheets I do: # fr becomes the pointer to the wxframe window self.fr = self.GetParent().GetParent().GetParent() Then in my code I can say self.fr.showMsg(0, 'Maximum points per item can only be given for test type 2') when I want to use the message function showMsg defined in the "main" class which only has to know how to use the message field outside of the tab sheet area. Or: self.fr.maxPnts = 100 to set the value of the attribute maxPnts in the "main" class or: self.fr.test.readFromDisk(path) to refer to an instance of a separate Test class to use its readFromDisk method. Cheers, Jussi http://personal.inet.fi/cool/operator/