On Aug 10, 2006, at 1:06 PM, kc1...@ya... wrote:
> Hi list,
>
> What's the proper way to pass parameters to child
> window?
>
> For instance, if I do:
>
> cw=model.childWindow(self, childWindowClass(a, b))
>
> and it appears I can't expect that the __init__
> routine in childWindowClass be:
>
> class childWindowClass(model.Background):
> def __init__(self, a, b):
>
> So, what exactly should I create childWindowClass
> with? I've been doing it with no parameters and then
> try to set the parameters of the child window
> afterwards but that's really ugly.
>
> How should I pass parameters to a childWindow?
>
> Thanks,
>
> --
> John Henry
Check out this reply from last year
http://article.gmane.org/gmane.comp.python.pythoncard/1346/
match=childwindow
The event handler you are creating the child window in has to finish
executing before you can be sure that the underlying C++ control has
"settled". The purpose of the on_initialize event for a background is
to avoid all the nasty bugs that can occur on the different platforms
if you try to do certain operations on controls during the underlying
initialization. As Brad mentioned, you can get data from the parent
window, but often what you'll want to do is simply use wx.CallAfter()
to set additional variables, call other methods, etc.
ka
|