Exemplo n.º 1
0
 def _delayed_property(self, widget, prop):
     prop_value = self.convert(prop)
     if prop_value is not None:
         prop_name = prop.attrib["name"]
         self.delayed_props.append((widget, False,
                 'set%s%s' % (ascii_upper(prop_name[0]), prop_name[1:]),
                 prop_value))
Exemplo n.º 2
0
    def setProperties(self, widget, elem):
        try:
            self.wclass = elem.attrib["class"]
        except KeyError:
            pass
        for prop in elem.findall("property"):
            prop_name = prop.attrib["name"]
            DEBUG("setting property %s" % (prop_name,))

            try:
                stdset = bool(int(prop.attrib["stdset"]))
            except KeyError:
                stdset = True

            if not stdset:
                self._setViaSetProperty(widget, prop)
            elif hasattr(self, prop_name):
                getattr(self, prop_name)(widget, prop)
            else:
                prop_value = self.convert(prop, widget)
                if prop_value is not None:
                    getattr(widget, "set%s%s" % (ascii_upper(prop_name[0]), prop_name[1:]))(prop_value)