Buttons
GuiButton
GuiButton(
title_and_content: Any,
content: Any | None = None,
*,
color: str | tuple[int, int, int] | None = None
)
Bases: GuiWidget
Simple button widget.
Overloads:
Parameters:
-
title_and_content
(Any
) –Widget's title and button text, should be unique among all widgets.
-
content
(Any | None
, default:None
) –Button text, if set
title_and_content
is used only for title -
color
(str | tuple[int, int, int] | None
, default:None
) –Button text color as color name or RGB tuple
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.
GuiToggleButton
GuiToggleButton(
title_and_content: Any,
content: Any | None = None,
*,
color: str | tuple[int, int, int] | None = None,
toggle_state: bool | None = None
)
Bases: GuiWidget
Toggleable button.
Overloads:
GuiToggleButton(
title: Any,
content: Any,
*,
color: str | tuple[int, int, int] | None = None,
toggle_state: bool = False
)
GuiToggleButton(
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
) –Button text
-
color
(str | tuple[int, int, int] | None
, default:None
) –Button text color as color name or RGB tuple
-
toggle_state
(bool | None
, default:None
) –Button initial toggle 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.
GuiButtonSelectorH
GuiButtonSelectorH(
title_and_content: Any | tuple[Any, ...] = None,
content: tuple[Any, ...] | None = None,
*,
color: str | tuple[int, int, int] | None = None,
select: int | str | None = None
)
Bases: GuiWidget
Button group to select value, horizontal layout.
Overloads:
GuiButtonSelectorH(
title: str,
content: tuple[str, ...],
*,
color: str | tuple[int, int, int] | None = None,
select: int | str | None = None
)
GuiButtonSelectorH(
content: tuple[str, ...],
*,
color: str | tuple[int, int, int] | None = None,
select: int | str | None = None
)
Parameters:
-
title
(Any
) –Widget's title
-
content
(tuple[Any, ...] | None
, default:None
) –Buttons' texts
-
color
(str | tuple[int, int, int] | None
, default:None
) –Selector button's text color as color name or RGB tuple
-
select
(int | str | None
, default:None
) –text or index of button to select initially
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.
GuiButtonSelectorV
GuiButtonSelectorV(
title_and_content: Any | tuple[Any, ...] = None,
content: tuple[Any, ...] | None = None,
*,
color: str | tuple[int, int, int] | None = None,
select: int | str | None = None
)
Bases: GuiWidget
Button group to select value, vertical layout.
Overloads:
GuiButtonSelectorV(
title: str,
content: tuple[str, ...],
*,
color: str | tuple[int, int, int] | None = None,
select: int | str | None = None
)
GuiButtonSelectorV(
content: tuple[str, ...],
*,
color: str | tuple[int, int, int] | None = None,
select: int | str | None = None
)
Parameters:
-
title
(Any
) –Widget's title
-
content
(tuple[Any, ...] | None
, default:None
) –Buttons' texts
-
color
(str | tuple[int, int, int] | None
, default:None
) –Selector button's text color as color name or RGB tuple
-
select
(int | str | None
, default:None
) –text or index of button to select initially
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.