From: Kevin A. <al...@se...> - 2004-08-24 07:28:56
|
On Aug 23, 2004, at 11:58 PM, jamesr wrote: > Hi - new voice on this list.. I am James in Maryland and having been > sucking up python card for about a month, to my great advantage. I > specialize in usuability issues, graphic design, and code like a crazy > monkey. (Take it all with grain of salt..) > > The multiple layout windows i briefly read about above may be overkill > - but a widget that 'encapsulates' other widgets could be handy in > this case. A vaguish suggestion - a 'Group' Widget that takes as it > items a list of other widget names. Setting an attribute of this > widget changes the attributes (if they have it) of all listed widgets > connected to it Immediately, I would use this to change the > visibility of groups of widgets with one call, but an ability to add > or subtract (relatively) from the position x and y from a group of > objects would be very handy too, as well as font or color. Anyone else > think of a use for this? > > again, generally i'd use it to hide and show groups of widgets that > support different functionality in one window. > > thanks, james, circlecycle'AT'gmail'dot'com If you want to do something like this today I suggest making a list of the component names that you can then do an operation on. For example... group = ['btnOne', 'btnTwo', 'fldOne', 'someList'] for c in group: self.components[c].visible = False ...could be used to make all the components in the "group" hidden. Rather than string names you could just as easily use the actual component references, it just depends on what you prefer. If you want to make this more generic then use setattr within a function that takes the group list, attribute name, and value as parameters. def groupChange(self, group, attribute, value): for name in group: setattr(self.components[name], attribute, value) attribute is a string like 'visible'. ka |