On Nov 11, 2004, at 12:27 PM, Arsalan Zaidi wrote:
>
> First up, PythonCard is great! Can't wait for version 1.0 :-)
>
> Now to the problem. I want to call a function in class derived from
> model.Background before I call the model.Pythoncrd mainloop. Something
> like this...
>
> app = model.PythonCardApp(Mail.Mail, aFileName='Mail.rsrc.py')
> Mail.Mail.foo(self.emailaddr, self.passwd, self.clientVer)
> app.MainLoop()
>
> Is something like this possible? Is there anyway to pass parameters etc
> to the obj contructed by model.PythonCardApp from Mail.Mail?
In general, you can't do much with wxPython or PythonCard until the
MainLoop() has been started, so you would want to do your
initialization in the on_initialize event handler instead.
However, if you do want to access the main background, you would need
to do it like so:
app.backgrounds[0].foo(emailaddr, passwd, clientVer)
Obviously you would need to initialize emailaddr, passwd, and clientVer
before calling foo.
Since PythonCard doesn't really take advantage of using multiple
backgrounds, the current list structure is overkill, so backgrounds[0]
type of references will probably be changed to just background in the
next release or two.
> And before I sign off, a wishlist for 1.0
>
> 1. Wizards (http://www.freenet.org.nz/python/PythonCard/)
> 2. Toolbars
>
> Thanks in advance!
>
> --Arsalan
Wizards and toolbars would be nice. I won't be doing much coding this
month though, so it will be a while before I take a look at your wizard
code. Andy Todd started an implementation for a simple Toolbar class
once, but I'm not sure how far he took it. It should be possible to do
an implementation similar to the PythonCard StatusBar class so that
there is a default one you can get easily and if you need a complex
ToolBar you could roll your own class and do whatever you want in pure
wxPython.
ka
|