magicgui.widgets._protocols

Protocols (interfaces) for backends to implement.

Each class in this module is a typing.Protocol that specifies a set of abstractmethod() that a backend widget must implement to be compatible with the magicgui API. All magicgui-specific abstract methods are prefaced with _mgui_*.

For an example backend implementation, see magicgui.backends._qtpy.widgets

WidgetProtocol

Base Widget Protocol: specifies methods that all widgets must provide.

ValueWidgetProtocol

Widget that has a current value, with getter/setter and on_change callback.

RangedWidgetProtocol

Value widget that supports numbers within a provided min/max range.

SupportsChoices

Widget that has a set of valid choices.

CategoricalWidgetProtocol

Categorical widget, that has a set of valid choices, and a current value.

SupportsText

Widget that have text (in addition to value).

ButtonWidgetProtocol

The “value” in a ButtonWidget is the current (checked) state.

SupportsOrientation

Widget that can be reoriented.

SliderWidgetProtocol

Protocol for implementing a slider widget.

ContainerProtocol

Widget that can contain other widgets.

BaseApplicationBackend

Backend Application object.