Text
GuiText
GuiText(
title_and_content: Any,
content: Any | None = None,
*,
color: str | tuple[int, int, int] | None = None,
toggle_state: bool = False
)
Bases: GuiWidget
Text widget. Goes grey on toggle off.
Tip
Use GuiText('⬤', 'LED 1', 'green')
for a toggleable "LED indicator".
Overloads:
GuiText(
title: Any,
content: Any,
*,
color: str | tuple[int, int, int] | None = None,
toggle_state: bool = False
)
GuiText(
content: Any,
*,
color: str | tuple[int, int, int] | None = None,
toggle_state: bool = False
)
Parameters:
-
title
(Any
) –Widget's title
-
content
(Any | None
, default:None
) –Widget's text
-
color
(str | tuple[int, int, int] | None
, default:None
) –Text color as color name or RGB tuple
-
toggle_state
(bool
, default:False
) –Text "grey out" state
calls
Message match arguments and callables that will be called with matching incoming messages.
None
conditions matches any message.
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 attribute it matches the attribute.
-
If condition is a container and contains the attribute 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.