Dear All:
I just wrote a module to help loading frame and dialog from XRC resource file easier. I would like to know what I can improve in this module. So, any suggestion are welcome.
xrcform.py (8.09 KB)
test01.py (2.78 KB)
test.xrc (6.41 KB)
···
–
Sincerely yours,
Gary Lee
A very nicely done module!
A few comments on how you can improve it:
Automatically binding events is an interesting concept although it
obscures the way the event functions get called a bit. I guess it
should be fine once you get used to it. I would implement
MethodNameToEvent a bit differently using split, join and maybe a bit
of regex magic to avoid looping through the characters, but that's
just a matter of personal preference.
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.
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.
···
On Jan 13, 2008 8:02 AM, Gary Lee <garywlee@gmail.com> wrote:
Dear All:
I just wrote a module to help loading frame and dialog from XRC resource
file easier. I would like to know what I can improve in this module. So, any
suggestion are welcome.
--
Sincerely yours,
Gary Lee
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
--
Eli Golovinsky
www.testuff.com