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
attribute on the message.
Example
Keyword arguments can be used to match additional selectors for attributes
listed in ALLOW_SELECTOR_MATCH
.
Example
Parameters
Parameter | Default | Description |
---|---|---|
message_type
type[Message]
|
required | The message type (i.e. the class). |
selector
str | None
|
None
|
An optional selector. If supplied, the handler will only be called if |
**kwargs
str
|
{}
|
Additional selectors for other attributes of the message. |