On¶
Decorator to declare that the method is a message handler.
The decorator accepts an optional CSS selector that will be matched against a widget exposed by
a control
property on the message.
Example
Keyword arguments can be used to match additional selectors for attributes
listed in ALLOW_SELECTOR_MATCH
.
Example
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
type[Message]
|
The message type (i.e. the class). |
required |
|
str | None
|
An optional selector. If supplied, the handler will only be called if |
None
|
|
str
|
Additional selectors for other attributes of the message. |
{}
|