[wxPython-users] A module to help load frame and dialog from XRC resource easily.

Gary Lee garywlee at gmail.com
Sun Jan 13 18:53:03 PST 2008


2008/1/13, Eli Golovinsky <gooli at testuff.com>:
>
> Your __getattr__implementation in XrcFrame seems to assume there are
> no other attributes in a frame other than the control it holds. That
> isn't always true and the implementation should first look for the
> attribute in __dict__ and only the do an XRCCTRL call.


Isn't __getattr__ called when the given attribute name can't be found in a
object, is it? So, the XRCCTRL call will be called only when the given
attribute not found in __dict__. I added the object loaded by XRCCTRL to
__dict__. Therefore, it won't be loaded again.

Another note on this: in order to make this module generally useful,
> you'll need to add support for handling menus and toolbars as well.


 Thanks for your suggestions. I am looking for a way to support menu and
toolbars. However, I never use Menu and Toolbar from XRC resource before.
Still have no idea. Any cool idea?





-- =


Sincerely yours,
Gary Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200801=
14/73362d9f/attachment.htm


More information about the wxpython-users mailing list