setattr what is the parent object?
gagsl-py2 at yahoo.com.ar
Tue Mar 25 21:08:09 CET 2008
En Tue, 25 Mar 2008 15:46:57 -0300, Jules Stevenson <lists at js3d.co.uk>
> I'm trying to use setattr to dynamically name and layout gui wx widgets,
> this is all fine and dandy until I've run up against something where I
> simply don't know what the object is, please see the amended **don't
> in the following code.
> class MyFrame2(wx.Frame):
> def __do_layout(self, mayaVars):
> main_boxSizer = wx.BoxSizer(wx.VERTICAL)
> for pDisplay in range(len(mayaVars.primary)):
> Without all the dynamic gumpf, the statmement looks like this:
> r_gridBagSizer = wx.GridBagSizer(vgap=0, hgap=0))
> All the other UI elements are created on 'self' but the sizers don't
> seem to
> 'belong' to anything - what should I use when this is the case?
You don't have to save the sizer anywhere, but you have to call
More information about the Python-list