def add_from_string(self, strdata):
        """Load ui definition from string."""
        if self.tree is None:
            self.tree = tree = ET.ElementTree(ET.fromstring(strdata))
            self.root = tree.getroot()
            self.objects = {}
        else:
            # TODO: append to current tree
            pass
def add_from_string ( self , strdata ) : if self . tree is None : self . tree = tree = ET . ElementTree ( ET . fromstring ( strdata ) ) self . root = tree . getroot ( ) self . objects = { } else : pass
Load ui definition from string.