To answer my own question, the variable in the OnInit section
(self.queueSize I think I called it) was defined below the self.Bind
statements I had. By moving the variable definition / object definition
above the BIND region, everything worked.
Is this a bug, or an accepted design parameter of wxPython?
Dave
···
----- Original Message -----
From: "GMane Python" <s_david_rose@hotmail.com>
Newsgroups: gmane.comp.python.wxpython
Sent: Friday, December 17, 2004 12:48 PM
Subject: Question about importing a class
Hello all.
In my OnInit(self) section of a program I'm hacking, I import a class
called
NetCam(). I then:
self.netcam = NetCam()
NetCam has a Queue object, diskQueue.I want to, from my wxPython's SystemTimeEvent(self, evt): which fires
every
second, to see what the current queue depth is and display it.
So, I have the line:
queueSize = self.netcam.diskQueue.qsize()
This gives me the error: Attribute Error: 'NetworkRecorderMainWindow'
object
has no attribute 'netcam'
but doing this same line in the OnInit section has no problem. I have
imported other objects like the LCD control from wxGizmos, and accessed it
no problem from the SystemTimeEvent() section no problem.I know it's gotta be something dumb that I overlooked, since I'm new,
that's
to be expected. Can someone point me in the right direction to get this
object accessible from my SystemTimeEvent() section please?Dave