GUI Event Message
GuiEvent
Bases: AttrEnum
GUI event type enumerator
to use as GuiEventMsg
type
attribute.
CONTENT_SET = 'CONTENT_SET'
COLOR_SET = 'COLOR_SET'
RANGE_SET = 'RANGE_SET'
TRIGGERED = 'TRIGGERED'
TOGGLED = 'TOGGLED'
SELECTED = 'SELECTED'
VALUE_CHANGED = 'VALUE_CHANGED'
GuiEventMsg
GuiEventMsg(
type: GuiEvent,
data: str | int | bool | Sequence | None = None,
*,
source: None | GuiWidget = None
)
Bases: Msg
GUI interaction message produced by GUI widget port.
Parameters:
-
source
(Input | None
, default:None
) –Input port instance that generated the message
data
New value set by event.
Data meaning for event types:
TRIGGERED - None
CONTENT_SET - New content
COLOR_SET - New text color
TOGGLED - New toggle state
SELECTED - Selected item text
VALUE_CHANGED - New value
RANGE_SET - New value range
matches
matches(
type: None | Container[GuiEvent] | GuiEvent = None,
data: None | Container | str | int | bool | Sequence = None,
) -> bool
Checks if message's attributes match all provided attribute conditions:
-
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.
Use Not(condition)
to invert condition matching.
Returns:
-
bool
–True
if all attributes match,False
if any does not match