def __init__(self, **kwargs): """ A group of controls with a specific layout. Controls can be added with Layout.append(). The layout will be applied when Layout.apply() is called. This happens automatically if a layout is appended to a Panel. """ kwargs["x"] = kwargs["y"] = kwargs["width"] = kwargs["height"] = 0 Layer.__init__(self, **kwargs) self._controls = {} # Lazy cache of (id, control)-children, see nested().
def __init__(self, x=0, y=0, **kwargs): """ A group of controls with a specific layout. Controls can be added with Layout.append(). The layout will be applied when Layout.apply() is called. This happens automatically if a layout is appended to a Panel. """ kwargs["width"] = 0 kwargs["height"] = 0 Layer.__init__(self, x=x, y=y, **kwargs) self._controls = {} # Lazy cache of (id, control)-children, see nested().
def __init__(self, x=0, y=0, id=None, **kwargs): """ Base class for GUI controls. The Control class inherits from Layer so it must be appended to the canvas (or a container) to receive events and get drawn. An id can be given to uniquely identify the control. If the control is part of a Panel, it can be retrieved with Panel.control_id. """ Layer.__init__(self, x=x, y=y, **kwargs) self.id = id self.src = {} # Collection of source images. self.enabled = True # Enable event listener. self.duration = 0 # Disable tweening. self._controls = {} # Lazy index of (id, control) children, see nested(). self._press = None