SourceForge logo
SourceForge logo
Menu

pythoncard-users

From: Cullen N. <cn...@sa...> - 2006年10月05日 18:32:15
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|
From: Liam C. <cy...@gm...> - 2006年10月06日 06:49:22
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
>
> 
From: Jussi S. <jus...@pp...> - 2006年10月06日 08:10:19
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/
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /