On Thu, 2 Nov 2006 20:51:29 +0100
Mattia Barbon <mat...@li...> wrote:
> On Wed, 25 Oct 2006 16:14:20 +0200
> Peter Gordon <pe...@pg...> wrote:
>
> Hi,
>
> > Attached are two files. One is a Perl program which
> > a) defines MyTextCtrl as a subclass of wxTextCtrl
> > b) installs an XRC handler
> > c) initializes the handlers
> > d) tries to lookup a Window using FindWindow
> > e) fails to get a handle
> >
> > The XRC was created using DialogBlocks with a small, but necessary
> > change. DialogBlocks defines the class wxTextCtrl, with a subclass of
> > MyTextCtrl. Perl does not like this. It seems to insist that the class
> > itself be MyTextCtrl. (Is this a wxPerl issue or a DialogBlocks issue?)
> >
> > The major problem is that the lookup on the window, ID_TEXTCTRL, fails.
> > If the class name in the xrc file is changed back to wxTextCtrl, the
> > program does not complain, so I don't think it is the result of a typo.
>
> I do not use XRC much. All I know is with
> "DialogBlocks defines the class wxTextCtrl, with a subclass of MyTextCtrl"
Me reread should before send hitting; sigh. Should have been:
I do not use XRC much. If with
"DialogBlocks defines the class wxTextCtrl, with a subclass of MyTextCtrl"
> you mean DialogBlocks generates <object class="wxTextCtrl"
> subclass="MyTextCtrl">, then you need to use a wxXmlSubclassFactory [1],
> otherwise you need <object class="MyTextCtrl"> and an handler like the
> one you wrote.
>
> HTH
> Mattia
>
> [1] http://sourceforge.net/mailarchive/message.php?msg_id=6155508
> http://sourceforge.net/mailarchive/message.php?msg_id=6840185
Regards
Mattia
|