'Creates an element by its type ID.'

def create_element(self, ui, typeid, *args, **kwargs):

    cls = self.get_class(typeid)
    inst = cls.new(ui, context=(ui or self).context, *args, **kwargs)
    inst.typeid = typeid
    return inst
