Module albow.widgets.RadioControl

Source code
from pygame import event
from albow.widgets.Control import Control


class RadioControl(Control):

    setting = None
    """
    The setting of the value that this radio button corresponds to.
    """

    def get_highlighted(self):
        return self.value == self.setting

    def mouse_down(self, e: event):
        self.value = self.setting

Classes

class RadioControl (*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 RadioControl(Control):

    setting = None
    """
    The setting of the value that this radio button corresponds to.
    """

    def get_highlighted(self):
        return self.value == self.setting

    def mouse_down(self, e: event):
        self.value = self.setting

Ancestors

Subclasses

Class variables

var setting

The setting of the value that this radio button corresponds to.

Methods

def get_highlighted(self)
Source code
def get_highlighted(self):
    return self.value == self.setting
def mouse_down(self, e)
Source code
def mouse_down(self, e: event):
    self.value = self.setting

Inherited members