[wxPython-users] Problems loading panel from XRC

Jorgen Bodde jorgen.maillist at gmail.com
Tue Sep 26 13:25:52 PDT 2006


Hi Robin,

Thanks again for the quick reply! I contacted Julian too and he suggested to
rename the custom class back to wxPanel in DialogBlocks to solve the
subclass problem. The missing tags that are not found are most likely indeed
the cause of a newer wxWidgets. I will try te preview build I was not aware
there was a wx2.7.0 build already

The subclass idea is nice though, it makes it even more dynamic. I will look
into that!

Thanks,
- Jorgen

On 9/26/06, Robin Dunn <robin at alldunn.com> wrote:
>
> Jorgen Bodde wrote:
> [...]
> > It works, but I get errors. The following errors are thrown at me but
> > the panel is succesfully loaded. Does anybody know why this happens?
> >
> > 20:09:25: Subclass 'WikedMain' not found for resource 'ID_WIKEDMAIN',
> > not subclassing!
> > 20:09:25: Unknown style flag wxHSCROLL
> > 20:09:25: Unknown style flag wxVSCROLL
> >
> > The first error puzzles me. Is the XRC code wrong that DialogBlocks
> > produces?
>
> No, see below.
>
> > The second and third ones are probably new in wxWidgets
> > newer then the ones used by wxPython?
>
> Probably.  Since 3.10 was just barely released I expect that Julian is
> using wx 2.7 to build it.  You can try with a 2.7 preview build of
> wxPython if you want.  See the wxPython-dev mail list and
> http://starship.python.net/crew/robind/wxPython/daily/
>
> >
> > The first error comes from this line;
> >
> > <object class=3D"wxPanel" name=3D"ID_WIKEDMAIN" subclass=3D"WikedMain">
> >
> > I do not know why the subclass line is there. Any ideas?
>
> Because you specified a class name in DialogBlocks (or perhaps it
> automatically did it.)  The subclass attribute is used by XRC to create
> the instance using a pluggable subclass factory instead of creating the
> class using the standard class in the class attribute.  In C++ the
> subclass factory can instantiate any class that uses the wxRTTI macros,
> but since your C++ binary (wxPython) doesn't have a class named
> WikedMain it is giving you the error.  So you probably just need to
> remove the class name attribute from DialogBlocks and then save the XRC
> again.
>
> BTW, there is a subclass factory loaded for Python classes too, but it
> requires that you specify the package/module name in front of the class
> name so the factory knows what to import to be able to find the class.
> See the demo for an example.
>
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org  Java give you jitters?  Relax with wxPython!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200609=
26/f197fd28/attachment.htm


More information about the wxpython-users mailing list