Module albow.widgets.CheckControl
Source code
from pygame import event
from albow.widgets.Control import Control
class CheckControl(Control):
def mouse_down(self, e: event):
self.value = not self.value
def get_highlighted(self):
return self.value
Classes
class CheckControl (*args, **kwargs)
-
Control is a mixin class for use by widgets that display and/or edit a value of some kind. It provides a value property that can be linked, via a reference object, to a specific attribute or item of another object. Reading and writing the value property then accesses the specified attribute or item.
If no such linkage is specified, a value is kept internally to the Control instance, and the value property accesses this internal value. Thus, a Control-based widget can be used stand-alone if desired.
Source code
class CheckControl(Control): def mouse_down(self, e: event): self.value = not self.value def get_highlighted(self): return self.value
Ancestors
Subclasses
Methods
def get_highlighted(self)
-
Source code
def get_highlighted(self): return self.value
def mouse_down(self, e)
-
Source code
def mouse_down(self, e: event): self.value = not self.value
Inherited members