Logo Search packages:      
Sourcecode: wajig version File versions

def glutil::Base::_map_widgets_into_lists (   self,
  widgetnames 
) [private]

Put sequentially numbered widgets into lists.

e.g. If an object had widgets self.button0, self.button1, ...,
then after a call to object._map_widgets_into_lists(['button'])
object has an attribute self.button == [self.button0,self.button1,...].

Definition at line 96 of file glutil.py.

00096                                                   :
        """Put sequentially numbered widgets into lists.

        e.g. If an object had widgets self.button0, self.button1, ...,
        then after a call to object._map_widgets_into_lists(['button'])
        object has an attribute self.button == [self.button0,self.button1,...].
        """
        for item in widgetnames:
            setattr(self, item, [])
            list = getattr(self, item)
            i = 0
            while 1:
                key = "%s%i"%(item,i)
                try:
                    val = getattr(self, key)
                except AttributeError:
                    break
                list.append(val)
                i += 1

########################################################################


Generated by  Doxygen 1.6.0   Back to index