Screen
screen
¶
Screen
¶
Bases: Widget
A widget for the root of the app.
focus_chain: list[Widget]
property
¶
A list of widgets that may receive focus, in focus order.
is_current: bool
property
¶
Is the screen current (i.e. visible to user)?
update_timer: Timer
property
¶
Timer used to perform updates.
find_widget(widget)
¶
Get the screen region of a Widget.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
widget |
Widget
|
A Widget within the composition. |
required |
Returns:
Type | Description |
---|---|
MapGeometry
|
Region relative to screen. |
Raises:
Type | Description |
---|---|
NoWidget
|
If the widget could not be found in this screen. |
focus_next(selector='*')
¶
Focus the next widget, optionally filtered by a CSS selector.
If no widget is currently focused, this will focus the first focusable widget.
If no focusable widget matches the given CSS selector, focus is set to None
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selector |
str | type[QueryType]
|
CSS selector to filter what nodes can be focused. |
'*'
|
Returns:
Type | Description |
---|---|
Widget | None
|
Newly focused widget, or None for no focus. If the return
is not |
focus_previous(selector='*')
¶
Focus the previous widget, optionally filtered by a CSS selector.
If no widget is currently focused, this will focus the first focusable widget.
If no focusable widget matches the given CSS selector, focus is set to None
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selector |
str | type[QueryType]
|
CSS selector to filter what nodes can be focused. |
'*'
|
Returns:
Type | Description |
---|---|
Widget | None
|
Newly focused widget, or None for no focus. If the return
is not |