[wxPython-users] A module to help load frame and dialog from XRC
resource easily.
Aaron Brady
castironpi at comcast.net
Mon Jan 14 09:04:44 PST 2008
> -----Original Message-----
> From: Mike Driscoll [mailto:mdriscoll at co.marshall.ia.us]
> Sent: Monday, January 14, 2008 10:01 AM
>
> > -----Original Message-----
> > From: Aaron Brady [mailto:castironpi at comcast.net]
> > Sent: Sunday, January 13, 2008 8:57 PM
> >
> > __getattribute__(
> > self, name)
> >
> > Called unconditionally to implement attribute accesses for
> > instances of the class. If the class also defines
> >
> > __getattr__(
> > self, name)
> >
> > Called when an attribute lookup has not found the attribute
> > in the usual places (i.e. it is not an instance attribute nor
>
> I'm a little confused with this whole thread. I didn't think that using
> the "magic" methods (or metaclasses) was a recommended Python programming
> practice. While it might be elegant to the person programming it, to less
> proficient programmers, it looks confusing. Maybe I'm just being nitpicky
> though. Aren't there some standard "setters" and "getters" ?
The dispute from earlier:
>>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.<<
Generally, I'd strike a midpoint between auto-bindings and hand-bys
(something done by hand). I assume the OP wanted something -more- automated
than this:
for contr, meth in Button1001, Button1002, ...:
contr.Bind( wx.EVT_BUTTON, Button_1001_1010_Click )
Did he want to avoid typing this list by using strings? -But-, does he want
ease to change the list of buttons later? Does the XRC version -require-
names for controls, and can those be used?
We segue into an interesting theory of form object design. What is code and
what is data?
More information about the wxpython-users
mailing list