Widget
The base class for widgets.
AwaitMount
class
¶
MountError
class
¶
Bases: WidgetError
Error raised when there was a problem with the mount request.
PseudoClasses
class
¶
Bases: NamedTuple
Used for render/render_line based widgets that use caching. This structure can be used as a cache-key.
Widget
class
¶
Bases: DOMNode
A Widget is the base class for Textual widgets.
See also static for starting point for your own widgets.
Parameters
Name | Type | Description | Default |
---|---|---|---|
*children |
Widget
|
Child widgets. |
()
|
name |
str | None
|
The name of the widget. |
None
|
id |
str | None
|
The ID of the widget in the DOM. |
None
|
classes |
str | None
|
The CSS classes for the widget. |
None
|
disabled |
bool
|
Whether the widget is disabled or not. |
False
|
BORDER_SUBTITLE
class-attribute
¶
Initial value for border_subtitle attribute.
allow_horizontal_scroll
property
¶
Check if horizontal scroll is permitted.
May be overridden if you want different logic regarding allowing scrolling.
allow_vertical_scroll
property
¶
Check if vertical scroll is permitted.
May be overridden if you want different logic regarding allowing scrolling.
auto_links
class-attribute
instance-attribute
¶
Widget will highlight links automatically.
border_subtitle
class-attribute
instance-attribute
¶
A title to show in the bottom border (if there is one).
border_title
class-attribute
instance-attribute
¶
A title to show in the top border (if there is one).
can_focus_children
class-attribute
instance-attribute
¶
Widget's children may receive focus.
container_size
property
¶
container_viewport
property
¶
The viewport region (parent window).
Returns
Type | Description |
---|---|
Region
|
The region that contains this widget. |
content_offset
property
¶
An offset from the Widget origin where the content begins.
Returns
Type | Description |
---|---|
Offset
|
Offset from widget's origin. |
content_region
property
¶
Gets an absolute region containing the content (minus padding and border).
Returns
Type | Description |
---|---|
Region
|
Screen region that contains a widget's content. |
content_size
property
¶
disabled
class-attribute
instance-attribute
¶
Is the widget disabled? Disabled widgets can not be interacted with, and are typically styled to look dimmer.
dock_gutter
property
¶
Space allocated to docks in the parent.
Returns
Type | Description |
---|---|
Spacing
|
Space to be subtracted from scrollable area. |
expand
class-attribute
instance-attribute
¶
Rich renderable may expand beyond optimal size.
gutter
property
¶
Spacing for padding / border / scrollbars.
Returns
Type | Description |
---|---|
Spacing
|
Additional spacing around content area. |
has_focus
class-attribute
instance-attribute
¶
Does this widget have focus? Read only.
highlight_link_id
class-attribute
instance-attribute
¶
The currently highlighted link id. Read only.
horizontal_scrollbar
property
¶
The a horizontal scrollbar.
Note
This will create a scrollbar if one doesn't exist.
Returns
Type | Description |
---|---|
ScrollBar
|
ScrollBar Widget. |
hover_style
class-attribute
instance-attribute
¶
The current hover style (style under the mouse cursor). Read only.
is_horizontal_scroll_end
property
¶
Is the horizontal scroll position at the maximum?
is_horizontal_scrollbar_grabbed
property
¶
Is the user dragging the vertical scrollbar?
is_vertical_scroll_end
property
¶
Is the vertical scroll position at the maximum?
is_vertical_scrollbar_grabbed
property
¶
Is the user dragging the vertical scrollbar?
layer
property
¶
layers
property
¶
link_hover_style
property
¶
mouse_over
class-attribute
instance-attribute
¶
Is the mouse over this widget? Read only.
offset
property
writable
¶
outer_size
property
¶
region
property
¶
scroll_offset
property
¶
Get the current scroll offset.
Returns
Type | Description |
---|---|
Offset
|
Offset a container has been scrolled by. |
scroll_x
class-attribute
instance-attribute
¶
The scroll position on the X axis.
scroll_y
class-attribute
instance-attribute
¶
The scroll position on the Y axis.
scrollable_content_region
property
¶
Gets an absolute region containing the scrollable content (minus padding, border, and scrollbars).
Returns
Type | Description |
---|---|
Region
|
Screen region that contains a widget's content. |
scrollbar_corner
property
¶
The scrollbar corner.
Note
This will create a scrollbar corner if one doesn't exist.
Returns
Type | Description |
---|---|
ScrollBarCorner
|
ScrollBarCorner Widget. |
scrollbar_gutter
property
¶
scrollbar_size_horizontal
property
¶
Get the height used by the horizontal scrollbar.
Returns
Type | Description |
---|---|
int
|
Number of rows in the horizontal scrollbar. |
scrollbar_size_vertical
property
¶
Get the width used by the vertical scrollbar.
Returns
Type | Description |
---|---|
int
|
Number of columns in the vertical scrollbar. |
scrollbars_enabled
property
¶
scrollbars_space
property
¶
The number of cells occupied by scrollbars for width and height
show_horizontal_scrollbar
class-attribute
instance-attribute
¶
Show a horizontal scrollbar?
show_vertical_scrollbar
class-attribute
instance-attribute
¶
Show a horizontal scrollbar?
shrink
class-attribute
instance-attribute
¶
Rich renderable may shrink below optimal size.
siblings
property
¶
size
property
¶
tooltip
property
writable
¶
Tooltip for the widget, or None
for no tooltip.
vertical_scrollbar
property
¶
The vertical scrollbar (create if necessary).
Note
This will create a scrollbar if one doesn't exist.
Returns
Type | Description |
---|---|
ScrollBar
|
ScrollBar Widget. |
virtual_region
property
¶
The widget region relative to it's container (which may not be visible, depending on scroll offset).
Returns
Type | Description |
---|---|
Region
|
The virtual region. |
virtual_region_with_margin
property
¶
The widget region relative to its container (including margin), which may not be visible, depending on the scroll offset.
Returns
Type | Description |
---|---|
Region
|
The virtual region of the Widget, inclusive of its margin. |
visible_siblings
property
¶
window_region
property
¶
The region within the scrollable area that is currently visible.
Returns
Type | Description |
---|---|
Region
|
New region. |
animate
method
¶
def animate(
self,
attribute,
value,
*,
final_value=Ellipsis,
duration=None,
speed=None,
delay=0.0,
easing=DEFAULT_EASING,
on_complete=None
):
Animate an attribute.
Parameters
Name | Type | Description | Default |
---|---|---|---|
attribute |
str
|
Name of the attribute to animate. |
required |
value |
float | Animatable
|
The value to animate to. |
required |
final_value |
object
|
The final value of the animation. Defaults to |
Ellipsis
|
duration |
float | None
|
The duration of the animate. |
None
|
speed |
float | None
|
The speed of the animation. |
None
|
delay |
float
|
A delay (in seconds) before the animation starts. |
0.0
|
easing |
EasingFunction | str
|
An easing method. |
DEFAULT_EASING
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
begin_capture_print
method
¶
Capture text from print statements (or writes to stdout / stderr).
If printing is captured, the widget will be sent an events.Print message.
Call end_capture_print to disable print capture.
Parameters
Name | Type | Description | Default |
---|---|---|---|
stdout |
bool
|
Capture stdout. |
True
|
stderr |
bool
|
Capture stderr. |
True
|
blur
method
¶
Blur (un-focus) the widget.
Focus will be moved to the next available widget in the focus chain..
Returns
Type | Description |
---|---|
Self
|
The |
can_view
method
¶
Check if a given widget is in the current view (scrollable area).
Note: This doesn't necessarily equate to a widget being visible. There are other reasons why a widget may not be visible.
Parameters
Name | Type | Description | Default |
---|---|---|---|
widget |
Widget
|
A widget that is a descendant of self. |
required |
Returns
Type | Description |
---|---|
bool
|
True if the entire widget is in view, False if it is partially visible or not in view. |
capture_mouse
method
¶
Capture (or release) the mouse.
When captured, mouse events will go to this widget even when the pointer is not directly over the widget.
Parameters
Name | Type | Description | Default |
---|---|---|---|
capture |
bool
|
True to capture or False to release. |
True
|
check_message_enabled
method
¶
compose
method
¶
end_capture_print
method
¶
End print capture (set with [capture_print][textual.widget.Widget.capture_print]).
focus
method
¶
Give focus to this widget.
Parameters
Name | Type | Description | Default |
---|---|---|---|
scroll_visible |
bool
|
Scroll parent to make this widget visible. |
True
|
Returns
Type | Description |
---|---|
Self
|
The |
get_child_by_id
method
¶
Return the first child (immediate descendent) of this node with the given ID.
Parameters
Name | Type | Description | Default |
---|---|---|---|
id |
str
|
The ID of the child. |
required |
expect_type |
type[ExpectType] | None
|
Require the object be of the supplied type, or None for any type. |
None
|
Returns
Type | Description |
---|---|
ExpectType | Widget
|
The first child of this node with the ID. |
Raises
Type | Description |
---|---|
NoMatches
|
if no children could be found for this ID |
WrongType
|
if the wrong type was found. |
get_child_by_type
method
¶
get_component_rich_style
method
¶
get_content_height
method
¶
Called by Textual to get the height of the content area. May be overridden in a subclass.
Parameters
Name | Type | Description | Default |
---|---|---|---|
container |
Size
|
Size of the container (immediate parent) widget. |
required |
viewport |
Size
|
Size of the viewport. |
required |
width |
int
|
Width of renderable. |
required |
Returns
Type | Description |
---|---|
int
|
The height of the content. |
get_content_width
method
¶
Called by textual to get the width of the content area. May be overridden in a subclass.
Parameters
Name | Type | Description | Default |
---|---|---|---|
container |
Size
|
Size of the container (immediate parent) widget. |
required |
viewport |
Size
|
Size of the viewport. |
required |
Returns
Type | Description |
---|---|
int
|
The optimal width of the content. |
get_pseudo_class_state
method
¶
Get an object describing whether each pseudo class is present on this object or not.
Returns
Type | Description |
---|---|
PseudoClasses
|
A PseudoClasses object describing the pseudo classes that are present. |
get_pseudo_classes
method
¶
get_style_at
method
¶
get_widget_by_id
method
¶
Return the first descendant widget with the given ID.
Performs a depth-first search rooted at this widget.
Parameters
Name | Type | Description | Default |
---|---|---|---|
id |
str
|
The ID to search for in the subtree. |
required |
expect_type |
type[ExpectType] | None
|
Require the object be of the supplied type, or None for any type. |
None
|
Returns
Type | Description |
---|---|
ExpectType | Widget
|
The first descendant encountered with this ID. |
Raises
Type | Description |
---|---|
NoMatches
|
if no children could be found for this ID. |
WrongType
|
if the wrong type was found. |
mount
method
¶
Mount widgets below this widget (making this widget a container).
Parameters
Name | Type | Description | Default |
---|---|---|---|
*widgets |
Widget
|
The widget(s) to mount. |
()
|
before |
int | str | Widget | None
|
Optional location to mount before. An |
None
|
after |
int | str | Widget | None
|
Optional location to mount after. An |
None
|
Returns
Type | Description |
---|---|
AwaitMount
|
An awaitable object that waits for widgets to be mounted. |
Raises
Type | Description |
---|---|
MountError
|
If there is a problem with the mount request. |
Note
Only one of before
or after
can be provided. If both are
provided a MountError
will be raised.
mount_all
method
¶
Mount widgets from an iterable.
Parameters
Name | Type | Description | Default |
---|---|---|---|
widgets |
Iterable[Widget]
|
An iterable of widgets. |
required |
before |
int | str | Widget | None
|
Optional location to mount before. An |
None
|
after |
int | str | Widget | None
|
Optional location to mount after. An |
None
|
Returns
Type | Description |
---|---|
AwaitMount
|
An awaitable object that waits for widgets to be mounted. |
Raises
Type | Description |
---|---|
MountError
|
If there is a problem with the mount request. |
Note
Only one of before
or after
can be provided. If both are
provided a MountError
will be raised.
move_child
method
¶
Move a child widget within its parent's list of children.
Parameters
Name | Type | Description | Default |
---|---|---|---|
child |
int | Widget
|
The child widget to move. |
required |
before |
int | Widget | None
|
Child widget or location index to move before. |
None
|
after |
int | Widget | None
|
Child widget or location index to move after. |
None
|
Raises
Type | Description |
---|---|
WidgetError
|
If there is a problem with the child or target. |
Note
Only one of before
or after
can be provided. If neither
or both are provided a WidgetError
will be raised.
notify
method
¶
Create a notification.
Tip
This method is thread-safe.
Parameters
Name | Type | Description | Default |
---|---|---|---|
message |
str
|
The message for the notification. |
required |
title |
str
|
The title for the notification. |
''
|
severity |
SeverityLevel
|
The severity of the notification. |
'information'
|
timeout |
float
|
The timeout for the notification. |
Notification.timeout
|
See App.notify
for the full
documentation for this method.
post_message
method
¶
post_render
method
¶
Applies style attributes to the default renderable.
Returns
Type | Description |
---|---|
ConsoleRenderable
|
A new renderable. |
refresh
method
¶
Initiate a refresh of the widget.
This method sets an internal flag to perform a refresh, which will be done on the next idle event. Only one refresh will be done even if this method is called multiple times.
By default this method will cause the content of the widget to refresh, but not change its size. You can also
set layout=True
to perform a layout.
Warning
It is rarely necessary to call this method explicitly. Updating styles or reactive attributes will do this automatically.
Parameters
Name | Type | Description | Default |
---|---|---|---|
*regions |
Region
|
Additional screen regions to mark as dirty. |
()
|
repaint |
bool
|
Repaint the widget (will call render() again). |
True
|
layout |
bool
|
Also layout widgets in the view. |
False
|
Returns
Type | Description |
---|---|
Self
|
The |
release_mouse
method
¶
Release the mouse.
Mouse events will only be sent when the mouse is over the widget.
remove
method
¶
Remove the Widget from the DOM (effectively deleting it).
Returns
Type | Description |
---|---|
AwaitRemove
|
An awaitable object that waits for the widget to be removed. |
remove_children
method
¶
Remove all children of this Widget from the DOM.
Returns
Type | Description |
---|---|
AwaitRemove
|
An awaitable object that waits for the children to be removed. |
render
method
¶
render_line
method
¶
render_lines
method
¶
render_str
method
¶
run_action
async
¶
Perform a given action, with this widget as the default namespace.
Parameters
Name | Type | Description | Default |
---|---|---|---|
action |
str
|
Action encoded as a string. |
required |
scroll_down
method
¶
def scroll_down(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll one line down.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_end
method
¶
def scroll_end(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll to the end of the container.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_home
method
¶
def scroll_home(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll to home position.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if animate is |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_left
method
¶
def scroll_left(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll one cell left.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_page_down
method
¶
def scroll_page_down(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll one page down.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if animate is |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_page_left
method
¶
def scroll_page_left(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll one page left.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if animate is |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_page_right
method
¶
def scroll_page_right(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll one page right.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if animate is |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_page_up
method
¶
def scroll_page_up(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll one page up.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if animate is |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_relative
method
¶
def scroll_relative(
self,
x=None,
y=None,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll relative to current position.
Parameters
Name | Type | Description | Default |
---|---|---|---|
x |
float | None
|
X distance (columns) to scroll, or |
None
|
y |
float | None
|
Y distance (rows) to scroll, or |
None
|
animate |
bool
|
Animate to new scroll position. |
True
|
speed |
float | None
|
Speed of scroll if |
None
|
duration |
float | None
|
Duration of animation, if animate is |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_right
method
¶
def scroll_right(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll one cell right.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if animate is |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_to
method
¶
def scroll_to(
self,
x=None,
y=None,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll to a given (absolute) coordinate, optionally animating.
Parameters
Name | Type | Description | Default |
---|---|---|---|
x |
float | None
|
X coordinate (column) to scroll to, or |
None
|
y |
float | None
|
Y coordinate (row) to scroll to, or |
None
|
animate |
bool
|
Animate to new scroll position. |
True
|
speed |
float | None
|
Speed of scroll if |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
Note
The call to scroll is made after the next refresh.
scroll_to_center
method
¶
def scroll_to_center(
self,
widget,
animate=True,
*,
speed=None,
duration=None,
easing=None,
force=False,
origin_visible=True,
on_complete=None
):
Scroll this widget to the center of self.
The center of the widget will be scrolled to the center of the container.
Parameters
Name | Type | Description | Default |
---|---|---|---|
widget |
Widget
|
The widget to scroll to the center of self. |
required |
animate |
bool
|
Whether to animate the scroll. |
True
|
speed |
float | None
|
Speed of scroll if animate is |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
origin_visible |
bool
|
Ensure that the top left corner of the widget remains visible after the scroll. |
True
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_to_region
method
¶
def scroll_to_region(
self,
region,
*,
spacing=None,
animate=True,
speed=None,
duration=None,
easing=None,
center=False,
top=False,
origin_visible=True,
force=False,
on_complete=None
):
Scrolls a given region in to view, if required.
This method will scroll the least distance required to move region
fully within
the scrollable area.
Parameters
Name | Type | Description | Default |
---|---|---|---|
region |
Region
|
A region that should be visible. |
required |
spacing |
Spacing | None
|
Optional spacing around the region. |
None
|
animate |
bool
|
|
True
|
speed |
float | None
|
Speed of scroll if |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
top |
bool
|
Scroll |
False
|
origin_visible |
bool
|
Ensure that the top left of the widget is within the window. |
True
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
Returns
Type | Description |
---|---|
Offset
|
The distance that was scrolled. |
scroll_to_widget
method
¶
def scroll_to_widget(
self,
widget,
*,
animate=True,
speed=None,
duration=None,
easing=None,
center=False,
top=False,
origin_visible=True,
force=False,
on_complete=None
):
Scroll scrolling to bring a widget in to view.
Parameters
Name | Type | Description | Default |
---|---|---|---|
widget |
Widget
|
A descendant widget. |
required |
animate |
bool
|
|
True
|
speed |
float | None
|
Speed of scroll if |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
top |
bool
|
Scroll widget to top of container. |
False
|
origin_visible |
bool
|
Ensure that the top left of the widget is within the window. |
True
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
Returns
Type | Description |
---|---|
bool
|
|
scroll_up
method
¶
def scroll_up(
self,
*,
animate=True,
speed=None,
duration=None,
easing=None,
force=False,
on_complete=None
):
Scroll one line up.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
scroll_visible
method
¶
def scroll_visible(
self,
animate=True,
*,
speed=None,
duration=None,
top=False,
easing=None,
force=False,
on_complete=None
):
Scroll the container to make this widget visible.
Parameters
Name | Type | Description | Default |
---|---|---|---|
animate |
bool
|
Animate scroll. |
True
|
speed |
float | None
|
Speed of scroll if animate is |
None
|
duration |
float | None
|
Duration of animation, if |
None
|
top |
bool
|
Scroll to top of container. |
False
|
easing |
EasingFunction | str | None
|
An easing method for the scrolling animation. |
None
|
force |
bool
|
Force scrolling even when prohibited by overflow styling. |
False
|
on_complete |
CallbackType | None
|
A callable to invoke when the animation is finished. |
None
|
stop_animation
async
¶
watch_disabled
method
¶
Update the styles of the widget and its children when disabled is toggled.
watch_has_focus
method
¶
Update from CSS if has focus state changes.
watch_mouse_over
method
¶
Update from CSS if mouse over state changes.