subclassing wxMenuBar...
Bjorn Pettersen
BPettersen at NAREX.com
Tue Jun 5 11:42:00 EDT 2001
> From: Tom Jenkins [mailto:tjenkins at devis.com]
> Bjorn Pettersen wrote:
>
> > I was stepping through the wxPython tutorial, and came
> across the part
> > where they're creating the menus. It seemed like a good
> idea to put the
> > menu definition in a datafile instead of specifying it
> programatically,
> > so I though it would be a good chance to get some xml
> experience too...
> >
>
>
> Yep, that makes sense...
>
> [snip]
>
>
> > which I'm assuming means that the SWIGd code is expecting a
> wxMenuBar
> > pointer to be the first argument to Append and can't deal with a
> > subclass...
> >
> > Does anyone know a way around this?
> >
> > -- bjorn
> >
> >
>
> Well I wouldn't subclass wxMenuBar; instead I'd create a helper class
> that would handle reading the xml and loading it into the
> wxMenuBar. I
> took your code and changed it to work as a helper. Along the way I
> added some functionality.
Cool. Thanks! I was wondering how I would easily add callback
definitions :-)
-- bjorn
More information about the Python-list
mailing list