Robin Dunn wrote:
Basil Shubin wrote:
>Robin Dunn wrote:
Basil Shubin wrote:
Robin Dunn wrote:
Basil Shubin wrote:
# get masked controls start/finish time
self.startTime = xrc.XRCCTRL(self.parent, 'startTime')
self.finishTime = xrc.XRCCTRL(self.parent, 'finishTime')
For the above example I make following changes:
self.parent.Bind(wx.lib.masked.EVT_TIMEUPDATE,
TimeUpdate,
self.startTime.timeCtrl)
and I recive an error:
AttributeError: 'WorkoutTime' object has no attribute 'timeCtrl'
What is my fault?
You probably want to use just self.startTime, don't you? Are you
expecting self.startTime to have a timeCtrl attribute? Do you give
it one in your code anyplace?
>>
>I am puzzled totally! Yes, I want to use just self.startTime. timeCtrl
>is created in the Create method of WorkoutTime subclass, is it
>timeCtrl its attribute or what? self.startTime itself is not
>wxTimeCtrl, right? so it cannot recive EVT_TIMEUPDATE event, right?
>Uhh, I am totally puzzled! :-(
I think I am confused now too.
What type is self.startTime? I assume that is the object you are
creating with your XRC subclass?
If it is not a TimeCtrl, but contains one, then yes, you'll need to do
something like self.startTime.timeCtrl to get to it, but if
self.startTime.timeCtrl is not created until the Create then it may
not exist yet. approach you can take is to move the event handler
to the WorkoutTime class and do the binding in Create. Then the
handler can call a method in the parent if needed, or perhaps just send
a message, or whatever.
Doh! I am still confused!
Can somebody give me explanation how I can get value from self.time.Ctrl
that from WorkoutTime in other class - WorkoutsTab. Please, give me
explanation on a example code I provide. Is it what I do is right? Maybe
I should done this task in other way?
Thanks for any help!
To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org