Types
Export some objects that are used by Textual and that help document other features.
ActionParseResult
module-attribute
¶
An action is its name and the arbitrary tuple of its arguments.
CallbackType
module-attribute
¶
Type used for arbitrary callables used in callbacks.
CursorType
module-attribute
¶
The legal types of cursors for DataTable.cursor_type
.
EasingFunction
module-attribute
¶
Signature for a function that parametrises animation speed.
An easing function must map the interval [0, 1] into the interval [0, 1].
WatchCallbackType
module-attribute
¶
WatchCallbackType = Union[
Callable[[], Awaitable[None]],
Callable[[Any], Awaitable[None]],
Callable[[Any, Any], Awaitable[None]],
Callable[[], None],
Callable[[Any], None],
Callable[[Any, Any], None],
]
Type used for callbacks passed to the watch
method of widgets.
Animatable
class
¶
Bases: Protocol
Protocol for objects that can have their intrinsic values animated.
For example, the transition between two colors can be animated
because the class Color
satisfies this protocol.
MessageTarget
class
¶
Bases: Protocol
Protocol that must be followed by objects that can receive messages.
NoActiveAppError
class
¶
Bases: RuntimeError
Runtime error raised if we try to retrieve the active app when there is none.
RenderStyles
class
¶
Bases: StylesBase
Presents a combined view of two Styles object: a base Styles and inline Styles.
gutter
property
¶
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 |
str | 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
|
merge
method
¶
Merge values from another Styles.
Parameters
Name | Type | Description | Default |
---|---|---|---|
other |
StylesBase
|
A Styles object. |
required |