class controls.Control(object)
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 specifed, 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.
Widgets in the Albow library inheriting from Control include TextField, IntField, FloatField, CheckBox and RadioButton.
Attributes
- ref = None
- Reference to an external value. If supplied, it should be a reference object or other object providing the following methods:
- get()
- Should return the current value.
- set(x)
- Should set the value to x.
Properties
- value
- The current value of the Control. If a ref
has been supplied, accesses the value that it specifies. Otherwise,
accesses a value stored internally in a private attribute of the
Control.
---