Skip to content

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)

Bases: Msg

GUI interaction message produced by GUI widget

Parameters:

  • type (str) –

    Message distinctive type

type

type: GuiEvent

GUI event type

data

data: str | int | bool | Sequence | None = 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:

  1. If condition is None or omitted, it matches anything.

  2. If condition equals attribute, it matches the attribute.

  3. If condition is a container (list, tuple, range, etc.) and contains the attribute, it matches the attribute.

Use Not(condition) to invert condition matching. Use Glob(pattern) or Regex(pattern) for string pattern matching.

Returns:

  • bool –

    True if all attributes match, False if any does not match