GUI Widget
GuiWidget
GuiWidget(
content: str | Sequence[str] | None = None,
*,
color: str | tuple[int, int, int] | None = None,
value: str | int | bool | None = None,
select: int | str | None = None,
toggle_state: bool | None = None,
range: tuple[int, int] | None = None,
title: str | None = None
)
Bases: GuiWindowItem
, Subscribable
GUI windows widget which can have calls subscribed to it's
GuiEventMsg
.
Parameters:
-
content
(str | Sequence[str] | None
, default:None
) –Widget's text or text for its items
-
color
(str | tuple[int, int, int] | None
, default:None
) –Color as color name or RGB tuple
-
value
(str | int | bool | None
, default:None
) –Initial value
-
select
(int | str | None
, default:None
) –Preselected item
-
toggle_state
(bool | None
, default:None
) –Initial toggle state
-
title
(str | None
, default:None
) –Title for dock widget and position saving, set by content or type if
None
qt_widget
Wrapped PySide6
QWidget
that can be altered for extra customization
select
Select widget's item
Parameters:
-
selection
(int | str
) –Index or text of item to select
subscribe
subscribe(
type: None | Container[GuiEvent] | GuiEvent = None,
data: None | Container | str | int | bool | Sequence = None,
) -> Callable
Decorator to subscribe a callable to the input's messages.
Decorator without arguments subscribes a callable to all the input's messages.
Decorator with arguments subscribes a callable to the input's messages
that match conditions set by arguments.
It works the same way as message's matches
method:
-
If condition is
None
or omitted it matches anything. -
If condition equals the message's attribute value it matches the attribute.
-
If condition is a container (list, tuple) and contains the message's attribute value, it matches the attribute.
Examples
- Calls function for all MIDI port's messages:
- Calls function for OSC messages from specific address:
- Call object instance method for MIDI port's "note on" and "note off" messages:
Returns:
-
Callable
–Subscribed callable.