From: Brad A. <bra...@ma...> - 2006-08-12 00:13:19
|
John Henry wrote: >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? You can't, as far as I know. It would be a nice feature to add, but you can have the child window request data from the parent via self.getParent(). Also, you can't use __init__ for PythonCard classes, you have to use on_initialize; I recall that was due to timing issues but someone else can probably explain better. |