classDiagram
class Message {
time: float
is_forwarded: bool
handler_name: str
can_replace(message): bool
prevent_default(prevent: bool): Message
stop(stop: bool): Message
}
Message <|-- Event
Event <|-- Resize
Event <|-- Compose
Event <|-- Mount
Mount <|-- Unmount
Event <|-- Show
Event <|-- Hide
Event <|-- InputEvent
InputEvent <|-- Key
InputEvent <|-- MouseEvent
Event <|-- Timer
Event <|-- Enter
Event <|-- Leave
Event <|-- Focus
Event <|-- Blur
Event <|-- Paste
MouseEvent <|-- Click
MouseEvent <|-- MouseDown
MouseEvent <|-- MouseUp
MouseEvent <|-- MouseScrollDown
MouseEvent <|-- MouseScrollUp
MouseEvent <|-- MouseMove
Message handler names are composed from the message class name and optionally the message namespace:
name = camel_to_snake(self.__class__.__name__)
self._handler_name = (
f"on_{self.namespace}_{name}" if self.namespace else f"on_{name}"
)
classDiagram
class InputEvent{
}
class Key {
key: str
character: str
name: str
is_printable: bool
aliases: list[str]
}
class MouseEvent {
x: int
y: int
delta_x: int
delta_y: int
button: int
shift: bool
meta: bool
ctrl: bool
screen_x: int
screen_y: int
style: Style
}
Event <|-- InputEvent
InputEvent <|-- Key
InputEvent <|-- MouseEvent
MouseEvent <|-- Click
MouseEvent <|-- MouseDown
MouseEvent <|-- MouseUp
MouseEvent <|-- MouseScrollDown
MouseEvent <|-- MouseScrollUp
MouseEvent <|-- MouseMove
classDiagram
Event <|-- Callback
Event <|-- ShutdownRequest
Event <|-- Shutdown
Event <|-- Load
Event <|-- Idle
Event <|-- Action
Event <|-- Ready
Event <|-- MouseCapture
Event <|-- MouseRelease
Event <|-- DescendantFocus
Event <|-- DescendantBlur
Event <|-- ScreenResume
Event <|-- ScreenSuspend
Code used to generate the widgets.md file: