Control

class pyto_ui.Control

The base class for controls, which are visual elements that convey a specific action or intention in response to user interactions.

Inherited by Button, SegmentedControl, Slider, Switch and TextField

property action: callable

A function called when the control triggers its action. For example, a Button object calls this function when it’s pressed.

Takes the Control object as parameter.

Return type:

callable

property enabled: bool

A boolean indicating whether the control is enabled.

Return type:

bool

property horizontal_alignment: HorizontalAlignment

The horizontal alignment of the view’s contents. See Horizontal Alignment constants for possible values.

Return type:

Horizontal Alignment

property vertical_alignment: VerticalAlignment

The vertical alignment of the view’s contents. See Vertical Alignemnt constants for possible values.

Return type:

Vertical Alignment