From 0caf35f6aa09622602585b7600ffbed03076b75b Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 22 Oct 2024 14:45:44 +0100 Subject: [PATCH] Deployed 3d65f2be4 with MkDocs version: 1.6.1 --- api/app/index.html | 14850 +++++++----- api/await_complete/index.html | 361 +- api/await_remove/index.html | 43 +- api/binding/index.html | 1996 +- api/cache/index.html | 1156 +- api/color/index.html | 3375 ++- api/command/index.html | 2852 ++- api/constants/index.html | 320 +- api/containers/index.html | 2330 +- api/coordinate/index.html | 293 +- api/dom_node/index.html | 5947 +++-- api/errors/index.html | 112 +- api/events/index.html | 3769 ++- api/filter/index.html | 1982 +- api/fuzzy_matcher/index.html | 546 +- api/geometry/index.html | 8517 ++++--- api/lazy/index.html | 129 +- api/logger/index.html | 991 +- api/logging/index.html | 181 +- api/map_geometry/index.html | 189 +- api/message/index.html | 449 +- api/message_pump/index.html | 1918 +- api/on/index.html | 174 +- api/pilot/index.html | 1972 +- api/query/index.html | 2664 ++- api/reactive/index.html | 1335 +- api/renderables/index.html | 1127 +- api/screen/index.html | 3151 ++- api/scroll_view/index.html | 968 +- api/scrollbar/index.html | 455 +- api/signal/index.html | 624 +- api/strip/index.html | 2440 +- api/suggester/index.html | 677 +- api/system_commands_source/index.html | 291 +- api/timer/index.html | 538 +- api/types/index.html | 1410 +- api/validation/index.html | 3432 ++- api/walk/index.html | 486 +- api/widget/index.html | 17338 +++++++++----- api/work/index.html | 348 +- api/worker/index.html | 1547 +- api/worker_manager/index.html | 750 +- assets/_mkdocstrings.css | 137 +- .../index.html | 2 +- events/app_blur/index.html | 33 +- events/app_focus/index.html | 33 +- events/blur/index.html | 32 +- events/click/index.html | 32 +- events/descendant_blur/index.html | 48 +- events/descendant_focus/index.html | 48 +- events/enter/index.html | 34 +- events/focus/index.html | 32 +- events/hide/index.html | 32 +- events/key/index.html | 220 +- events/leave/index.html | 34 +- events/load/index.html | 32 +- events/mount/index.html | 32 +- events/mouse_capture/index.html | 83 +- events/mouse_down/index.html | 32 +- events/mouse_move/index.html | 32 +- events/mouse_release/index.html | 83 +- events/mouse_scroll_down/index.html | 32 +- events/mouse_scroll_up/index.html | 32 +- events/mouse_up/index.html | 32 +- events/paste/index.html | 83 +- events/print/index.html | 124 +- events/resize/index.html | 165 +- events/screen_resume/index.html | 32 +- events/screen_suspend/index.html | 32 +- events/show/index.html | 32 +- events/unmount/index.html | 32 +- feed_rss_created.xml | 2 +- feed_rss_updated.xml | 2 +- guide/command_palette/index.html | 2 +- guide/events/index.html | 4 +- guide/reactivity/index.html | 570 +- guide/widgets/index.html | 4 +- how-to/render-and-compose/index.html | 1699 +- objects.inv | Bin 13705 -> 74353 bytes search/search_index.json | 2 +- tutorial/index.html | 414 +- widgets/button/index.html | 1874 +- widgets/checkbox/index.html | 508 +- widgets/collapsible/index.html | 833 +- widgets/content_switcher/index.html | 753 +- widgets/data_table/index.html | 9633 +++++--- widgets/digits/index.html | 548 +- widgets/directory_tree/index.html | 2066 +- widgets/footer/index.html | 365 +- widgets/header/index.html | 449 +- widgets/input/index.html | 2216 +- widgets/label/index.html | 24 +- widgets/list_item/index.html | 238 +- widgets/list_view/index.html | 1822 +- widgets/loading_indicator/index.html | 225 +- widgets/log/index.html | 1271 +- widgets/markdown/index.html | 1453 +- widgets/markdown_viewer/index.html | 2690 ++- widgets/masked_input/index.html | 1057 +- widgets/option_list/index.html | 3843 +-- widgets/placeholder/index.html | 432 +- widgets/pretty/index.html | 331 +- widgets/progress_bar/index.html | 915 +- widgets/radiobutton/index.html | 537 +- widgets/radioset/index.html | 733 +- widgets/rich_log/index.html | 1107 +- widgets/rule/index.html | 1130 +- widgets/select/index.html | 1598 +- widgets/selection_list/index.html | 2913 ++- widgets/sparkline/index.html | 417 +- widgets/static/index.html | 509 +- widgets/switch/index.html | 674 +- widgets/tabbed_content/index.html | 2844 ++- widgets/tabs/index.html | 3645 ++- widgets/text_area/index.html | 19522 ++++++++++------ widgets/toast/index.html | 128 +- widgets/tree/index.html | 5826 +++-- 117 files changed, 112694 insertions(+), 60774 deletions(-) diff --git a/api/app/index.html b/api/app/index.html index e8f069251a..b392277761 100644 --- a/api/app/index.html +++ b/api/app/index.html @@ -4977,7 +4977,7 @@
  • - textual.app +  app @@ -4986,7 +4986,7 @@
  • - AutopilotCallbackType +  AutopilotCallbackType @@ -4995,7 +4995,7 @@
  • - CommandCallback +  CommandCallback @@ -5004,7 +5004,7 @@
  • - ScreenType +  ScreenType @@ -5013,7 +5013,7 @@
  • - ActionError +  ActionError @@ -5022,7 +5022,7 @@
  • - ActiveModeError +  ActiveModeError @@ -5031,17 +5031,53 @@
  • - App +  App -
  • + +
  • + + +  get_css_variables + + -
  • - +
  • +
  • + + +  get_default_screen + + - - textual.await_complete - +
  • + +
  • + + +  get_driver_class + + - - -
  • + + +
  • + + +  get_key_display + + - - - - - + +
  • + +
  • + + +  get_loading_widget + + +
  • + +
  • + + +  get_screen + + -
  • - + - - - - - +
  • + +
  • + + +  get_system_commands + + + +
  • + +
  • + + +  get_widget_at + + -
  • - + +
  • + +
  • + + +  get_widget_by_id + + + - - textual.cache - +
  • + +
  • + + +  handle_bindings_clash + + - - -
  • + + + +
  • + + +  install_screen + + + - - -
  • + + +
  • + + +  is_mounted + + - - - - - + +
  • + +
  • + + +  is_screen_installed + + + - - textual.command - +
  • + +
  • + + +  mount + + - - -
  • + + + +
  • + + +  mount_all + + -
  • - + +
  • + +
  • + + +  notify + + + +
  • + +
  • + + +  open_url + + + - - -
  • + + +
  • + + +  panic + + - - - - - + +
  • + +
  • + + +  pop_screen + + +
  • + +
  • + + +  post_display_hook + + -
  • - +
  • +
  • + + +  push_screen + + - - textual.dom - + +
  • + +
  • + + +  push_screen_wait + + + - - textual.events - +
  • + +
  • + + +  recompose + + - - -
  • + + +
  • + + +  refresh + + - - - - - + -
  • - +
  • +
  • + + +  refresh_css + + - - textual.errors - + - - - - - +
  • + +
  • + + +  remove_mode + + + +
  • + +
  • + + +  render + + -
  • - +
  • +
  • + + +  run + + - - textual.filter - - - - -
  • - - - - - - + - - - - - + + +
  • + + +  run_action + + + -
  • - +
  • +
  • + + +  run_async + + - - textual.geometry - + - - textual.lazy - +
  • + +
  • + + +  run_test + + - - -
  • + - - textual - + + +
  • + + +  save_screenshot + + - - -
  • + + + +
  • + + +  set_focus + + -
  • - + +
  • + +
  • + + +  set_keymap + + + -
  • - +
  • +
  • + + +  simulate_key + + - - textual.map_geometry - + - - - - - +
  • + +
  • + + +  stop_animation + + + -
  • - +
  • +
  • + + +  suspend + + - - textual.message_pump - +
  • + +
  • + + +  switch_mode + + - - -
  • + + + +
  • + + +  switch_screen + + + -
  • - +
  • +
  • + + +  uninstall_screen + + - - textual.message - + - - - - - +
  • + +
  • + + +  update_keymap + + + +
  • + +
  • + + +  update_styles + + -
  • - +
  • +
  • + + +  validate_sub_title + + - - textual.on - +
  • + +
  • + + +  validate_title + + - - -
  • + + +
  • + + +  watch_dark + + - - - - - +
  • + + + + + +
  • + + +  AppError + + +
  • + +
  • + + +  InvalidModeError + + +
  • + +
  • + + +  ModeError + + -
  • - - +
  • + +
  • + + +  ScreenError + + - - textual.pilot - +
  • + +
  • + + +  ScreenStackError + + - - +
  • + +
  • + + +  SuspendNotSupported + + + +
  • + +
  • + + +  SystemCommand + + + + + +
  • + +
  • + + +  UnknownModeError + + + +
  • + +
  • + + +  get_system_commands_provider + + + +
  • + + + + + @@ -6889,11 +7924,11 @@
  • - + - textual.css.query + textual.await_complete @@ -6910,11 +7945,11 @@
  • - + - textual.reactive + textual.await_remove @@ -6931,11 +7966,11 @@
  • - + - textual.renderables + textual.binding @@ -6952,11 +7987,11 @@
  • - + - textual.screen + textual.cache @@ -6973,11 +8008,11 @@
  • - + - textual.scrollbar + textual.color @@ -6994,11 +8029,11 @@
  • - + - textual.scroll_view + textual.command @@ -7015,11 +8050,11 @@
  • - + - textual.signal + textual.constants @@ -7036,11 +8071,11 @@
  • - + - textual.strip + textual.containers @@ -7057,11 +8092,11 @@
  • - + - textual.suggester + textual.coordinate @@ -7078,11 +8113,11 @@
  • - + - textual.system_commands + textual.dom @@ -7099,11 +8134,11 @@
  • - + - textual.timer + textual.events @@ -7120,11 +8155,11 @@
  • - + - textual.types + textual.errors @@ -7141,11 +8176,11 @@
  • - + - textual.validation + textual.filter @@ -7162,11 +8197,11 @@
  • - + - textual.walk + textual.fuzzy @@ -7183,11 +8218,11 @@
  • - + - textual.widget + textual.geometry @@ -7204,11 +8239,11 @@
  • - + - textual.work + textual.lazy @@ -7225,11 +8260,11 @@
  • - + - textual.worker + textual @@ -7246,11 +8281,11 @@
  • - + - textual.worker_manager + textual.logging @@ -7260,75 +8295,25 @@ - - - -
  • - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - -
  • - - - - +
  • + - - - - - - + + + + + + +
  • + + + + + textual.reactive + + + +
  • - - - + + + +
  • - + - FAQ + textual.renderables @@ -7462,19 +8461,20 @@
  • - - - + + + +
  • - + - Roadmap + textual.screen @@ -7482,63 +8482,48 @@
  • - - - + + + + - - - - - - - - - - - - - - - - - -
  • - - - - +
  • + - - -
  • + + - - + + + + + + +
  • + - + + + + + + +
    +
    +
    + + + - -
  • + + +
  • + + +  compose + + - - - - - - - - - - -
    -
    -
    - - -
  • + +
  • + + +  copy_to_clipboard + + + +
  • + +
  • + + +  deliver_binary + + - - + +
  • + +
  • + + +  merge + + - - -

    textual.binding

    - + + +
  • + + + + + + +
  • + + +  InvalidBinding + + + +
  • + +
  • + + +  KeymapApplyResult + + + + + +
  • + +
  • + + +  NoBinding + + + +
  • + + + + + + + + + + +
    +
    + + + + + + + +

    textual.binding

    +
    + -
    - -

    This module contains the Binding class and related objects.

    +
    + +

    This module contains the Binding class and related objects.

    See bindings in the guide for details.

    - + + + + + +
    @@ -7142,22 +7484,22 @@

    textual.binding

    - BindingIDString + BindingIDString + - module-attribute

    -
    BindingIDString: TypeAlias = str
    +
    BindingIDString = str
     
    -
    - -

    The ID of a Binding defined somewhere in the application.

    +
    + +

    The ID of a Binding defined somewhere in the application.

    Corresponds to the id parameter of the Binding class.

    -
    +
    @@ -7166,23 +7508,23 @@

    - BindingType + BindingType + - module-attribute

    -
    BindingType: TypeAlias = (
    +
    BindingType = (
         "Binding | tuple[str, str] | tuple[str, str, str]"
     )
     
    -
    - -

    The possible types of a binding found in the BINDINGS class variable.

    -
    +
    + +

    The possible types of a binding found in the BINDINGS class variable.

    +
    @@ -7191,22 +7533,22 @@

    - KeyString + KeyString + - module-attribute

    -
    KeyString: TypeAlias = str
    +
    KeyString = str
     
    -
    - -

    A string that represents a key binding.

    +
    + +

    A string that represents a key binding.

    For example, "x", "ctrl+i", "ctrl+shift+a", "ctrl+j,space,x", etc.

    -
    +
    @@ -7215,21 +7557,21 @@

    - Keymap + Keymap + - module-attribute

    -
    Keymap = Mapping[BindingIDString, KeyString]
    +
     
    -  
    - -

    A mapping of binding IDs to key strings, used for overriding default key bindings.

    -
    +
    + +

    A mapping of binding IDs to key strings, used for overriding default key bindings.

    +
    @@ -7239,22 +7581,27 @@

    - ActiveBinding + ActiveBinding

    -
    -

    - Bases: NamedTuple

    +
    +

    + Bases: NamedTuple

    + + + +

    Information about an active binding (returned from active_bindings).

    + + + + - -

    Information about an active binding (returned from active_bindings).

    -
    @@ -7269,21 +7616,21 @@

    - binding + binding + - instance-attribute

    -
    binding: Binding
    +
    binding
     
    -
    - -

    The binding information.

    -
    +
    + +

    The binding information.

    +
    @@ -7292,21 +7639,21 @@

    - enabled + enabled + - instance-attribute

    -
    enabled: bool
    +
    enabled
     
    -
    - -

    Is the binding enabled? (enabled bindings are typically rendered dim)

    -
    +
    + +

    Is the binding enabled? (enabled bindings are typically rendered dim)

    +
    @@ -7315,21 +7662,21 @@

    - node + node + - instance-attribute

    -
    node: DOMNode
    +
    node
     
    -
    - -

    The node where the binding is defined.

    -
    +
    + +

    The node where the binding is defined.

    +
    @@ -7338,22 +7685,22 @@

    - tooltip + tooltip + - - instance-attribute class-attribute + instance-attribute

    -
    tooltip: str = ''
    +
    tooltip = ''
     
    -
    - -

    Optional tooltip shown in Footer.

    -
    +
    + +

    Optional tooltip shown in Footer.

    +
    @@ -7363,7 +7710,7 @@

    -
    +
    @@ -7372,24 +7719,39 @@

    - Binding + Binding + - dataclass

    +
    Binding(
    +    key,
    +    action,
    +    description="",
    +    show=True,
    +    key_display=None,
    +    priority=False,
    +    tooltip="",
    +    id=None,
    +)
    +
    + +
    + + + +

    The configuration of a key binding.

    + + -
    - -

    The configuration of a key binding.

    -
    @@ -7404,21 +7766,21 @@

    - action + action + - instance-attribute

    -
    action: str
    +
    action
     
    -
    - -

    Action to bind to.

    -
    +
    + +

    Action to bind to.

    +
    @@ -7427,22 +7789,22 @@

    - description + description + - - instance-attribute class-attribute + instance-attribute

    -
    description: str = ''
    +
    description = ''
     
    -
    - -

    Description of action.

    -
    +
    + +

    Description of action.

    +
    @@ -7451,24 +7813,24 @@

    - id + id + - - instance-attribute class-attribute + instance-attribute

    -
    id: str | None = None
    +
    id = None
     
    -
    - -

    ID of the binding. Intended to be globally unique, but uniqueness is not enforced.

    +
    + +

    ID of the binding. Intended to be globally unique, but uniqueness is not enforced.

    If specified in the App's keymap then Textual will use this ID to lookup the binding, and substitute the key property of the Binding with the key specified in the keymap.

    -
    +
    @@ -7477,21 +7839,21 @@

    - key + key + - instance-attribute

    -
    key: str
    +
    key
     
    -
    - -

    Key to bind. This can also be a comma-separated list of keys to map multiple keys to a single action.

    -
    +
    + +

    Key to bind. This can also be a comma-separated list of keys to map multiple keys to a single action.

    +
    @@ -7500,24 +7862,24 @@

    - key_display + key_display + - - instance-attribute class-attribute + instance-attribute

    -
    key_display: str | None = None
    +
    key_display = None
     
    -
    - -

    How the key should be shown in footer.

    +
    + +

    How the key should be shown in footer.

    If None, the display of the key will use the result of App.get_key_display.

    If overridden in a keymap then this value is ignored.

    -
    +
    @@ -7526,22 +7888,22 @@

    - priority + priority + - - instance-attribute class-attribute + instance-attribute

    -
    priority: bool = False
    +
    priority = False
     
    -
    - -

    Enable priority binding for this key.

    -
    +
    + +

    Enable priority binding for this key.

    +
    @@ -7550,22 +7912,22 @@

    - show + show + - - instance-attribute class-attribute + instance-attribute

    -
    show: bool = True
    +
    show = True
     
    -
    - -

    Show the action in Footer, or False to hide.

    -
    +
    + +

    Show the action in Footer, or False to hide.

    +
    @@ -7574,22 +7936,22 @@

    - tooltip + tooltip + - - instance-attribute class-attribute + instance-attribute

    -
    tooltip: str = ''
    +
    tooltip = ''
     
    -
    - -

    Optional tooltip to show in footer.

    -
    +
    + +

    Optional tooltip to show in footer.

    +
    @@ -7598,178 +7960,210 @@

    -

    - make_bindings + make_bindings + - classmethod

    -
    make_bindings(bindings)
    +
    make_bindings(bindings)
     
    -
    - -

    Convert a list of BindingType (the types that can be specified in BINDINGS) +

    + +

    Convert a list of BindingType (the types that can be specified in BINDINGS) into an Iterable[Binding].

    Compound bindings like "j,down" will be expanded into 2 Binding instances.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    bindings - Iterable[BindingType] -

    An iterable of BindingType.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    bindings +

    + Iterable[BindingType] + +
    +

    An iterable of BindingType.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Iterable[Binding] -

    An iterable of Binding.

    TypeDescription
    + + + + + Iterable[Binding] + + +
    +

    An iterable of Binding.

    +
    + + + + -
    +
    -

    - parse_key + parse_key

    -
    parse_key()
    +
    parse_key()
     
    -
    - -

    Parse a key in to a list of modifiers, and the actual key.

    +
    -

    Returns:

    - - - - - - - - +

    Parse a key in to a list of modifiers, and the actual key.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - tuple[list[str], str] -

    A tuple of (MODIFIER LIST, KEY).

    TypeDescription
    + + + + + tuple[list[str], str] + + +
    +

    A tuple of (MODIFIER LIST, KEY).

    +
    + + + + -
    +
    -

    - with_key + with_key

    -
    with_key(key, key_display=None)
    +
    with_key(key, key_display=None)
     
    -
    - -

    Return a new binding with the key and key_display set to the specified values.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Return a new binding with the key and key_display set to the specified values.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    key - str -

    The new key to set.

    - required -
    + - - - - + + + + - -
    key_display - str | None -

    The new key display to set.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    key +

    + str + +
    +

    The new key to set.

    +
    +
    + required +
    +

    key_display +

    + str | None + +
    +

    The new key display to set.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - Binding -

    A new binding with the key set to the specified value.

    TypeDescription
    + + + + + Binding + + +
    +

    A new binding with the key set to the specified value.

    +
    + + + + -
    +
    @@ -7777,7 +8171,7 @@

    -
    +

    @@ -7786,22 +8180,27 @@

    - BindingError + BindingError

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    A binding related error.

    + + +

    A binding related error.

    -
    + + + + +
    @@ -7810,43 +8209,51 @@

    - BindingsMap + BindingsMap

    -
    BindingsMap(bindings=None)
    +
    BindingsMap(bindings=None)
     
    -
    +
    - -

    Manage a set of bindings.

    - -

    Parameters:

    - - - - - - - - - - +

    Manage a set of bindings.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    bindings - Iterable[BindingType] | None -

    An optional set of initial bindings.

    - None - NameTypeDescriptionDefault
    + + + + +

    bindings +

    + + Iterable[BindingType] | None + + +
    +

    An optional set of initial bindings.

    +
    + + + None + + + + +
    Note @@ -7855,7 +8262,12 @@

    properties of a Binding.

    - + + + + + +
    @@ -7870,21 +8282,21 @@

    - key_to_bindings + key_to_bindings + - instance-attribute

    -
    key_to_bindings: dict[str, list[Binding]] = {}
    +
    key_to_bindings = {}
     
    -
    - -

    Mapping of key (e.g. "ctrl+a") to list of bindings for that key.

    -
    +
    + +

    Mapping of key (e.g. "ctrl+a") to list of bindings for that key.

    +
    @@ -7893,21 +8305,21 @@

    - shown_keys + shown_keys + - property

    -
    shown_keys: list[Binding]
    +
    shown_keys
     
    -
    - -

    A list of bindings for shown keys.

    -
    +
    + +

    A list of bindings for shown keys.

    +
    @@ -7916,400 +8328,485 @@

    -

    - apply_keymap + apply_keymap

    -
    apply_keymap(keymap)
    +
    apply_keymap(keymap)
     
    -
    - -

    Replace bindings for keys that are present in keymap.

    +
    + +

    Replace bindings for keys that are present in keymap.

    Preserves existing bindings for keys that are not in keymap.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    keymap - Keymap -

    A keymap to overlay.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    Name TypeDescription
    +

    keymap +

    + Keymap + +
    +

    A keymap to overlay.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    KeymapApplyResult - KeymapApplyResult -

    The result of applying the keymap, including any clashed bindings.

    Name TypeDescription
    + + + +KeymapApplyResult + KeymapApplyResult + + +
    +

    The result of applying the keymap, including any clashed bindings.

    +
    + + + + -
    +
    -

    - bind + bind

    -
    bind(
    -    keys,
    -    action,
    -    description="",
    -    show=True,
    -    key_display=None,
    -    priority=False,
    +
    bind(
    +    keys,
    +    action,
    +    description="",
    +    show=True,
    +    key_display=None,
    +    priority=False,
     )
     
    -
    - -

    Bind keys to an action.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Bind keys to an action.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    keys - str -

    The keys to bind. Can be a comma-separated list of keys.

    - required -
    action - str -

    The action to bind the keys to.

    - required -
    description - str -

    An optional description for the binding.

    - '' -
    show - bool -

    A flag to say if the binding should appear in the footer.

    - True -
    key_display - str | None -

    Optional string to display in the footer for the key.

    - None -
    + - - - - + + + + - -
    priority - bool -

    Is this a priority binding, checked form app down to focused widget?

    - False - NameTypeDescriptionDefault
    + + + + +

    keys +

    + + str + + +
    +

    The keys to bind. Can be a comma-separated list of keys.

    +
    + + + required + + + + +

    action +

    + + str + + +
    +

    The action to bind the keys to.

    +
    + + + required + + + + +

    description +

    + + str + + +
    +

    An optional description for the binding.

    +
    + + + '' + + + + +

    show +

    + + bool + + +
    +

    A flag to say if the binding should appear in the footer.

    +
    + + + True + + + + +

    key_display +

    + + str | None + + +
    +

    Optional string to display in the footer for the key.

    +
    + + + None + + + + +

    priority +

    + + bool + + +
    +

    Is this a priority binding, checked form app down to focused widget?

    +
    + + + False + + + + -
    +
    -

    - copy + copy

    -
    copy()
    +
    copy()
     
    -
    - -

    Return a copy of this instance.

    +
    + +

    Return a copy of this instance.

    +
    Return

    New bindings object.

    -
    +
    -

    - from_keys + from_keys + - classmethod

    -
    from_keys(keys)
    +
    from_keys(keys)
     
    -
    - -

    Construct a BindingsMap from a dict of keys and bindings.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Construct a BindingsMap from a dict of keys and bindings.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    keys - dict[str, list[Binding]] -

    A dict that maps a key on to a list of Binding objects.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    keys +

    + dict[str, list[Binding]] + +
    +

    A dict that maps a key on to a list of Binding objects.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - BindingsMap -

    New BindingsMap

    TypeDescription
    + + + + + BindingsMap + + +
    +

    New BindingsMap

    +
    + + + + -
    +
    -

    - get_bindings_for_key + get_bindings_for_key

    -
    get_bindings_for_key(key)
    +
    get_bindings_for_key(key)
     
    -
    - -

    Get a list of bindings for a given key.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get a list of bindings for a given key.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    key - str -

    Key to look up.

    - required - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    key +

    + str + +
    +

    Key to look up.

    +
    +
    + required +
    + + +

    Raises:

    + + - - + + - -
    - NoBinding -

    If the binding does not exist.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + NoBinding + +
    +

    If the binding does not exist.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - list[Binding] -

    A list of bindings associated with the key.

    TypeDescription
    + + + + + list[Binding] + + +
    +

    A list of bindings associated with the key.

    +
    + + + + -
    +
    -

    - merge + merge + - classmethod

    -
    merge(bindings)
    +
    merge(bindings)
     
    -
    - -

    Merge a bindings.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Merge a bindings.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    bindings - Iterable[BindingsMap] -

    A number of bindings.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    bindings +

    + Iterable[BindingsMap] + +
    +

    A number of bindings.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - BindingsMap -

    New BindingsMap.

    TypeDescription
    + + + + + BindingsMap + + +
    +

    New BindingsMap.

    +
    + + + + -
    +
    @@ -8317,7 +8814,7 @@

    -
    +

    @@ -8326,22 +8823,27 @@

    - InvalidBinding + InvalidBinding

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    + + + +

    Binding key is in an invalid format.

    + + - -

    Binding key is in an invalid format.

    -
    + +
    @@ -8350,22 +8852,27 @@

    - KeymapApplyResult + KeymapApplyResult

    -
    -

    - Bases: NamedTuple

    +
    +

    + Bases: NamedTuple

    + + + +

    The result of applying a keymap.

    + + + + - -

    The result of applying a keymap.

    -
    @@ -8380,21 +8887,21 @@

    - clashed_bindings + clashed_bindings + - instance-attribute

    -
    clashed_bindings: set[Binding]
    +
    clashed_bindings
     
    -
    - -

    A list of bindings that were clashed and replaced by the keymap.

    -
    +
    + +

    A list of bindings that were clashed and replaced by the keymap.

    +
    @@ -8404,7 +8911,7 @@

    - NoBinding + NoBinding

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    + + + +

    A binding was not found.

    - -

    A binding was not found.

    -
    + + + +
    @@ -8437,7 +8949,7 @@

    -
    +
    diff --git a/api/cache/index.html b/api/cache/index.html index fd456639d2..59ad3920ad 100644 --- a/api/cache/index.html +++ b/api/cache/index.html @@ -5061,7 +5061,7 @@
  • - textual.cache +  cache @@ -5070,17 +5070,26 @@
  • - FIFOCache +  FIFOCache -
  • - LRUCache +  LRUCache -
  • diff --git a/api/constants/index.html b/api/constants/index.html index 57223367ce..ff789a8bb9 100644 --- a/api/constants/index.html +++ b/api/constants/index.html @@ -5124,7 +5124,7 @@
  • - textual.constants +  constants @@ -5133,7 +5133,7 @@
  • - COLOR_SYSTEM +  COLOR_SYSTEM @@ -5142,7 +5142,7 @@
  • - DEBUG +  DEBUG @@ -5151,7 +5151,7 @@
  • - DEVTOOLS_HOST +  DEVTOOLS_HOST @@ -5160,7 +5160,7 @@
  • - DEVTOOLS_PORT +  DEVTOOLS_PORT @@ -5169,7 +5169,7 @@
  • - DRIVER +  DRIVER @@ -5178,7 +5178,7 @@
  • - ESCAPE_DELAY +  ESCAPE_DELAY @@ -5187,7 +5187,7 @@
  • - FILTERS +  FILTERS @@ -5196,7 +5196,7 @@
  • - LOG_FILE +  LOG_FILE @@ -5205,7 +5205,7 @@
  • - MAX_FPS +  MAX_FPS @@ -5214,7 +5214,7 @@
  • - PRESS +  PRESS @@ -5223,7 +5223,7 @@
  • - SCREENSHOT_DELAY +  SCREENSHOT_DELAY @@ -5232,7 +5232,7 @@
  • - SCREENSHOT_FILENAME +  SCREENSHOT_FILENAME @@ -5241,7 +5241,7 @@
  • - SCREENSHOT_LOCATION +  SCREENSHOT_LOCATION @@ -5250,7 +5250,7 @@
  • - SHOW_RETURN +  SHOW_RETURN @@ -5259,7 +5259,7 @@
  • - SLOW_THRESHOLD +  SLOW_THRESHOLD @@ -5268,7 +5268,7 @@
  • - TEXTUAL_ANIMATIONS +  TEXTUAL_ANIMATIONS @@ -6558,7 +6558,7 @@
  • - textual.constants +  constants @@ -6567,7 +6567,7 @@
  • - COLOR_SYSTEM +  COLOR_SYSTEM @@ -6576,7 +6576,7 @@
  • - DEBUG +  DEBUG @@ -6585,7 +6585,7 @@
  • - DEVTOOLS_HOST +  DEVTOOLS_HOST @@ -6594,7 +6594,7 @@
  • - DEVTOOLS_PORT +  DEVTOOLS_PORT @@ -6603,7 +6603,7 @@
  • - DRIVER +  DRIVER @@ -6612,7 +6612,7 @@
  • - ESCAPE_DELAY +  ESCAPE_DELAY @@ -6621,7 +6621,7 @@
  • - FILTERS +  FILTERS @@ -6630,7 +6630,7 @@
  • - LOG_FILE +  LOG_FILE @@ -6639,7 +6639,7 @@
  • - MAX_FPS +  MAX_FPS @@ -6648,7 +6648,7 @@
  • - PRESS +  PRESS @@ -6657,7 +6657,7 @@
  • - SCREENSHOT_DELAY +  SCREENSHOT_DELAY @@ -6666,7 +6666,7 @@
  • - SCREENSHOT_FILENAME +  SCREENSHOT_FILENAME @@ -6675,7 +6675,7 @@
  • - SCREENSHOT_LOCATION +  SCREENSHOT_LOCATION @@ -6684,7 +6684,7 @@
  • - SHOW_RETURN +  SHOW_RETURN @@ -6693,7 +6693,7 @@
  • - SLOW_THRESHOLD +  SLOW_THRESHOLD @@ -6702,7 +6702,7 @@
  • - TEXTUAL_ANIMATIONS +  TEXTUAL_ANIMATIONS @@ -6731,12 +6731,18 @@

    textual.constants

    + -
    - -

    This module contains constants, which may be set in environment variables.

    +
    + +

    This module contains constants, which may be set in environment variables.

    + + + + + + -
    @@ -6751,23 +6757,21 @@

    textual.constants

    - COLOR_SYSTEM + COLOR_SYSTEM + - module-attribute

    -
    COLOR_SYSTEM: Final[str | None] = get_environ(
    -    "TEXTUAL_COLOR_SYSTEM", "auto"
    -)
    +
    COLOR_SYSTEM = get_environ('TEXTUAL_COLOR_SYSTEM', 'auto')
     
    -
    - -

    Force color system override.

    -
    +
    + +

    Force color system override.

    +
    @@ -6776,21 +6780,21 @@

    - DEBUG + DEBUG + - module-attribute

    -
    DEBUG: Final[bool] = _get_environ_bool('TEXTUAL_DEBUG')
    +
    DEBUG = _get_environ_bool('TEXTUAL_DEBUG')
     
    -
    - -

    Enable debug mode.

    -
    +
    + +

    Enable debug mode.

    +
    @@ -6799,23 +6803,23 @@

    - DEVTOOLS_HOST + DEVTOOLS_HOST + - module-attribute

    -
    DEVTOOLS_HOST: Final[str] = get_environ(
    +
    DEVTOOLS_HOST = get_environ(
         "TEXTUAL_DEVTOOLS_HOST", "127.0.0.1"
     )
     
    -
    - -

    The host where textual console is running.

    -
    +
    + +

    The host where textual console is running.

    +
    @@ -6824,23 +6828,23 @@

    - DEVTOOLS_PORT + DEVTOOLS_PORT + - module-attribute

    -
    DEVTOOLS_PORT: Final[int] = _get_environ_int(
    +
    DEVTOOLS_PORT = _get_environ_int(
         "TEXTUAL_DEVTOOLS_PORT", 8081
     )
     
    -
    - -

    Constant with the port that the devtools will connect to.

    -
    +
    + +

    Constant with the port that the devtools will connect to.

    +
    @@ -6849,23 +6853,21 @@

    - DRIVER + DRIVER + - module-attribute

    -
    DRIVER: Final[str | None] = get_environ(
    -    "TEXTUAL_DRIVER", None
    -)
    +
    DRIVER = get_environ('TEXTUAL_DRIVER', None)
     
    -
    - -

    Import for replacement driver.

    -
    +
    + +

    Import for replacement driver.

    +
    @@ -6874,23 +6876,21 @@

    - ESCAPE_DELAY + ESCAPE_DELAY + - module-attribute

    -
    ESCAPE_DELAY: Final[float] = (
    -    _get_environ_int("ESCDELAY", 100) / 1000.0
    -)
    +
    ESCAPE_DELAY = _get_environ_int('ESCDELAY', 100) / 1000.0
     
    -
    - -

    The delay (in seconds) before reporting an escape key (not used if the extend key protocol is available).

    -
    +
    + +

    The delay (in seconds) before reporting an escape key (not used if the extend key protocol is available).

    +
    @@ -6899,21 +6899,21 @@

    - FILTERS + FILTERS + - module-attribute

    -
    FILTERS: Final[str] = get_environ('TEXTUAL_FILTERS', '')
    +
    FILTERS = get_environ('TEXTUAL_FILTERS', '')
     
    -
    - -

    A list of filters to apply to renderables.

    -
    +
    + +

    A list of filters to apply to renderables.

    +
    @@ -6922,23 +6922,21 @@

    - LOG_FILE + LOG_FILE + - module-attribute

    -
    LOG_FILE: Final[str | None] = get_environ(
    -    "TEXTUAL_LOG", None
    -)
    +
    LOG_FILE = get_environ('TEXTUAL_LOG', None)
     
    -
    - -

    A last resort log file that appends all logs, when devtools isn't working.

    -
    +
    + +

    A last resort log file that appends all logs, when devtools isn't working.

    +
    @@ -6947,21 +6945,21 @@

    - MAX_FPS + MAX_FPS + - module-attribute

    -
    MAX_FPS: Final[int] = _get_environ_int('TEXTUAL_FPS', 60)
    +
    MAX_FPS = _get_environ_int('TEXTUAL_FPS', 60)
     
    -
    - -

    Maximum frames per second for updates.

    -
    +
    + +

    Maximum frames per second for updates.

    +
    @@ -6970,21 +6968,21 @@

    - PRESS + PRESS + - module-attribute

    -
    PRESS: Final[str] = get_environ('TEXTUAL_PRESS', '')
    +
    PRESS = get_environ('TEXTUAL_PRESS', '')
     
    -
    - -

    Keys to automatically press.

    -
    +
    + +

    Keys to automatically press.

    +
    @@ -6993,23 +6991,23 @@

    - SCREENSHOT_DELAY + SCREENSHOT_DELAY + - module-attribute

    -
    SCREENSHOT_DELAY: Final[int] = _get_environ_int(
    +
    SCREENSHOT_DELAY = _get_environ_int(
         "TEXTUAL_SCREENSHOT", -1
     )
     
    -
    - -

    Seconds delay before taking screenshot.

    -
    +
    + +

    Seconds delay before taking screenshot.

    +
    @@ -7018,23 +7016,23 @@

    - SCREENSHOT_FILENAME + SCREENSHOT_FILENAME + - module-attribute

    -
    SCREENSHOT_FILENAME: Final[str | None] = get_environ(
    +
    SCREENSHOT_FILENAME = get_environ(
         "TEXTUAL_SCREENSHOT_FILENAME"
     )
     
    -
    - -

    The filename to use for the screenshot.

    -
    +
    + +

    The filename to use for the screenshot.

    +
    @@ -7043,23 +7041,23 @@

    - SCREENSHOT_LOCATION + SCREENSHOT_LOCATION + - module-attribute

    -
    SCREENSHOT_LOCATION: Final[str | None] = get_environ(
    +
    SCREENSHOT_LOCATION = get_environ(
         "TEXTUAL_SCREENSHOT_LOCATION"
     )
     
    -
    - -

    The location where screenshots should be written.

    -
    +
    + +

    The location where screenshots should be written.

    +
    @@ -7068,23 +7066,21 @@

    - SHOW_RETURN + SHOW_RETURN + - module-attribute

    -
    SHOW_RETURN: Final[bool] = _get_environ_bool(
    -    "TEXTUAL_SHOW_RETURN"
    -)
    +
    SHOW_RETURN = _get_environ_bool('TEXTUAL_SHOW_RETURN')
     
    -
    - -

    Write the return value on exit.

    -
    +
    + +

    Write the return value on exit.

    +
    @@ -7093,24 +7089,24 @@

    - SLOW_THRESHOLD + SLOW_THRESHOLD + - module-attribute

    -
    SLOW_THRESHOLD: int = _get_environ_int(
    +
    SLOW_THRESHOLD = _get_environ_int(
         "TEXTUAL_SLOW_THRESHOLD", 500
     )
     
    -
    - -

    The time threshold (in milliseconds) after which a warning is logged +

    + +

    The time threshold (in milliseconds) after which a warning is logged if message processing exceeds this duration.

    -
    +
    @@ -7119,23 +7115,21 @@

    - TEXTUAL_ANIMATIONS + TEXTUAL_ANIMATIONS + - module-attribute

    -
    TEXTUAL_ANIMATIONS: Final[AnimationLevel] = (
    -    _get_textual_animations()
    -)
    +
    TEXTUAL_ANIMATIONS = _get_textual_animations()
     
    -
    - -

    Determines whether animations run or not.

    -
    +
    + +

    Determines whether animations run or not.

    +
    @@ -7145,7 +7139,7 @@

    -
    +
    diff --git a/api/containers/index.html b/api/containers/index.html index c0ba6f8a75..99238150a6 100644 --- a/api/containers/index.html +++ b/api/containers/index.html @@ -5145,7 +5145,7 @@
  • - textual.containers +  containers @@ -5154,179 +5154,632 @@
  • - Center +  Center -
  • - -
  • - + +
  • - + - ScrollableContainer +  Container - - -
  • + +
  • + + +  disabled + + - - - - - +
  • + + + + + +
  • + + +  Grid + + + +
  • + +
  • + + +  Horizontal + + + +
  • + +
  • + + +  HorizontalScroll + + + +
  • + +
  • + + +  Middle + + + + +
  • + +
  • + + +  ScrollableContainer + + + + + +
  • + +
  • + + +  Vertical + + + + + +
  • + +
  • + + +  VerticalScroll + + + + + +
  • + + + + + + + + + + + + + + + + +
  • + + + + + textual.coordinate + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.dom + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.events + + + + +
  • + + + + + + + + + + +
  • + @@ -6510,80 +6963,431 @@
  • - textual.containers +  containers + + + +
  • + +
  • + + +  Center + + + + + +
  • + +
  • + + +  Container + + + + + +
  • + +
  • + + +  Grid + + + + + +
  • + +
  • + + +  Horizontal + + + + + +
  • + +
  • + + +  HorizontalScroll + + + + + +
  • + +
  • + + +  Middle + + + + +
  • - + - Container +  ScrollableContainer -
  • - -
  • - +
  • @@ -6857,22 +8309,130 @@

    - Middle + Middle

    +
    Middle(
    +    *children,
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False,
    +)
    +
    + +
    +

    + Bases: Widget

    + + + +

    A container which aligns children on the Y axis.

    + + + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    +

    *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 +
    + + -
    -

    - Bases: Widget

    - -

    A container which aligns children on the Y axis.

    -
    @@ -6888,7 +8448,7 @@

    -
    +
    @@ -6897,22 +8457,130 @@

    - ScrollableContainer + ScrollableContainer

    +
    ScrollableContainer(
    +    *children,
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False,
    +)
    +
    + +
    +

    + Bases: Widget

    + + + +

    A scrollable container with vertical layout, and auto scrollbars on both axis.

    + + + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    +

    *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 +
    + + -
    -

    - Bases: Widget

    - -

    A scrollable container with vertical layout, and auto scrollbars on both axis.

    -
    @@ -6927,46 +8595,46 @@

    - BINDINGS + BINDINGS + - class-attribute

    -
    BINDINGS: list[BindingType] = [
    -    Binding("up", "scroll_up", "Scroll Up", show=False),
    -    Binding(
    -        "down", "scroll_down", "Scroll Down", show=False
    +
    BINDINGS = [
    +    Binding("up", "scroll_up", "Scroll Up", show=False),
    +    Binding(
    +        "down", "scroll_down", "Scroll Down", show=False
         ),
    -    Binding("left", "scroll_left", "Scroll Up", show=False),
    -    Binding(
    -        "right", "scroll_right", "Scroll Right", show=False
    +    Binding("left", "scroll_left", "Scroll Up", show=False),
    +    Binding(
    +        "right", "scroll_right", "Scroll Right", show=False
         ),
    -    Binding(
    -        "home", "scroll_home", "Scroll Home", show=False
    +    Binding(
    +        "home", "scroll_home", "Scroll Home", show=False
         ),
    -    Binding("end", "scroll_end", "Scroll End", show=False),
    -    Binding("pageup", "page_up", "Page Up", show=False),
    -    Binding(
    -        "pagedown", "page_down", "Page Down", show=False
    +    Binding("end", "scroll_end", "Scroll End", show=False),
    +    Binding("pageup", "page_up", "Page Up", show=False),
    +    Binding(
    +        "pagedown", "page_down", "Page Down", show=False
         ),
    -    Binding(
    -        "ctrl+pageup", "page_left", "Page Left", show=False
    +    Binding(
    +        "ctrl+pageup", "page_left", "Page Left", show=False
         ),
    -    Binding(
    +    Binding(
             "ctrl+pagedown",
             "page_right",
             "Page Right",
    -        show=False,
    +        show=False,
         ),
     ]
     
    -
    - -

    Keyboard bindings for scrollable containers.

    +
    + +

    Keyboard bindings for scrollable containers.

    @@ -7017,7 +8685,7 @@

    -
    +
    @@ -7027,7 +8695,7 @@

    -

    +
    @@ -7036,22 +8704,130 @@

    - Vertical + Vertical

    +
    Vertical(
    +    *children,
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False,
    +)
    +
    + +
    +

    + Bases: Widget

    + + + +

    A container with vertical layout and no scrollbars.

    + + + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    +

    *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 +
    + + -
    -

    - Bases: Widget

    - -

    A container with vertical layout and no scrollbars.

    -
    @@ -7067,7 +8843,7 @@

    -
    +
    @@ -7076,22 +8852,130 @@

    - VerticalScroll + VerticalScroll

    +
    VerticalScroll(
    +    *children,
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False,
    +)
    +
    + +
    +

    + Bases: ScrollableContainer

    + + + +

    A container with vertical layout and an automatic scrollbar on the Y axis.

    + + + +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    +

    *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 +
    + + -
    -

    - Bases: ScrollableContainer

    - -

    A container with vertical layout and an automatic scrollbar on the Y axis.

    -
    @@ -7107,7 +8991,7 @@

    -
    +
    @@ -7116,7 +9000,7 @@

    - + diff --git a/api/coordinate/index.html b/api/coordinate/index.html index 36cd643f82..b2995b6588 100644 --- a/api/coordinate/index.html +++ b/api/coordinate/index.html @@ -5166,7 +5166,7 @@
  • - textual.coordinate +  coordinate @@ -5175,17 +5175,17 @@
  • - Coordinate +  Coordinate -
  • + + + + @@ -7032,7 +7608,7 @@
  • - textual.dom +  dom @@ -7041,7 +7617,7 @@
  • - QueryOneCacheKey +  QueryOneCacheKey @@ -7050,7 +7626,7 @@
  • - WalkMethod +  WalkMethod @@ -7059,7 +7635,7 @@
  • - BadIdentifier +  BadIdentifier @@ -7068,7 +7644,7 @@
  • - DOMError +  DOMError @@ -7077,17 +7653,17 @@
  • - DOMNode +  DOMNode -
  • - NoScreen +  NoScreen @@ -7650,10 +8778,34 @@
  • - check_identifiers() +  check_identifiers + + + + +
  • @@ -7679,13 +8831,19 @@

    textual.dom

    + -
    - -

    The module contains DOMNode, the base class for any object within the Textual Document Object Model, +

    + +

    The module contains DOMNode, the base class for any object within the Textual Document Object Model, which includes all Widgets, Screens, and Apps.

    - + + + + + +
    @@ -7700,23 +8858,21 @@

    textual.dom

    - QueryOneCacheKey + QueryOneCacheKey + - module-attribute

    -
    QueryOneCacheKey: TypeAlias = (
    -    "tuple[int, str, Type[Widget] | None]"
    -)
    +
    QueryOneCacheKey = 'tuple[int, str, Type[Widget] | None]'
     
    -
    - -

    The key used to cache query_one results.

    -
    +
    + +

    The key used to cache query_one results.

    +
    @@ -7725,21 +8881,21 @@

    - WalkMethod + WalkMethod + - module-attribute

    -
    WalkMethod: TypeAlias = Literal['depth', 'breadth']
    +
    WalkMethod = Literal['depth', 'breadth']
     
    -
    - -

    Valid walking methods for the DOMNode.walk_children method.

    -
    +
    + +

    Valid walking methods for the DOMNode.walk_children method.

    +
    @@ -7749,22 +8905,27 @@

    - BadIdentifier + BadIdentifier

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    + + + +

    Exception raised if you supply a id attribute or class name in the wrong format.

    - -

    Exception raised if you supply a id attribute or class name in the wrong format.

    -
    + + + +
    @@ -7773,22 +8934,27 @@

    - DOMError + DOMError

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Base exception class for errors relating to the DOM.

    + + +

    Base exception class for errors relating to the DOM.

    -
    + + + + +
    @@ -7797,23 +8963,28 @@

    - DOMNode + DOMNode

    -
    DOMNode(*, name=None, id=None, classes=None)
    +
    DOMNode(*, name=None, id=None, classes=None)
     
    -
    -

    - Bases: MessagePump

    +
    +

    + Bases: MessagePump

    + + + +

    The base class for object that can be in the Textual DOM (App and Widget)

    + + + + - -

    The base class for object that can be in the Textual DOM (App and Widget)

    -
    @@ -7828,21 +8999,21 @@

    - BINDINGS + BINDINGS + - class-attribute

    -
    BINDINGS: list[BindingType] = []
    +
    BINDINGS = []
     
    -
    - -

    A list of key bindings.

    -
    +
    + +

    A list of key bindings.

    +
    @@ -7851,22 +9022,22 @@

    - BINDING_GROUP_TITLE + BINDING_GROUP_TITLE + - - instance-attribute class-attribute + instance-attribute

    -
    BINDING_GROUP_TITLE: str | None = None
    +
    BINDING_GROUP_TITLE = None
     
    -
    - -

    Title of widget used where bindings are displayed (such as in the key panel).

    -
    +
    + +

    Title of widget used where bindings are displayed (such as in the key panel).

    +
    @@ -7875,21 +9046,21 @@

    - COMPONENT_CLASSES + COMPONENT_CLASSES + - class-attribute

    -
    COMPONENT_CLASSES: set[str] = set()
    +
    COMPONENT_CLASSES = set()
     
    -
    - -

    Virtual DOM nodes, used to expose styles to line API widgets.

    -
    +
    + +

    Virtual DOM nodes, used to expose styles to line API widgets.

    +
    @@ -7898,21 +9069,21 @@

    - DEFAULT_CLASSES + DEFAULT_CLASSES + - class-attribute

    -
    DEFAULT_CLASSES: str = ''
    +
    DEFAULT_CLASSES = ''
     
    -
    - -

    Default classes argument if not supplied.

    -
    +
    + +

    Default classes argument if not supplied.

    +
    @@ -7921,21 +9092,21 @@

    - DEFAULT_CSS + DEFAULT_CSS + - class-attribute

    -
    DEFAULT_CSS: str = ''
    +
    DEFAULT_CSS = ''
     
    -
    - -

    Default TCSS.

    -
    +
    + +

    Default TCSS.

    +
    @@ -7944,21 +9115,21 @@

    - HELP + HELP + - class-attribute

    -
    HELP: str | None = None
    +
    HELP = None
     
    -
    - -

    Optional help text shown in help panel (Markdown format).

    -
    +
    + +

    Optional help text shown in help panel (Markdown format).

    +
    @@ -7967,21 +9138,21 @@

    - SCOPED_CSS + SCOPED_CSS + - class-attribute

    -
    SCOPED_CSS: bool = True
    +
    SCOPED_CSS = True
     
    -
    - -

    Should default css be limited to the widget type?

    -
    +
    + +

    Should default css be limited to the widget type?

    +
    @@ -7990,39 +9161,44 @@

    - ancestors + ancestors + - property

    -
    ancestors: list[DOMNode]
    +
    ancestors
     
    -
    - -

    A list of ancestor nodes found by tracing a path all the way back to App.

    +
    + +

    A list of ancestor nodes found by tracing a path all the way back to App.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - list[DOMNode] -

    A list of nodes.

    TypeDescription
    -
    + + + + + list[DOMNode] + + +
    +

    A list of nodes.

    +
    + + + + +
    @@ -8031,43 +9207,49 @@

    - ancestors_with_self + ancestors_with_self + - property

    -
    ancestors_with_self: list[DOMNode]
    +
    ancestors_with_self
     
    -
    - -

    A list of ancestor nodes found by tracing a path all the way back to App.

    +
    + +

    A list of ancestor nodes found by tracing a path all the way back to App.

    +
    Note

    This is inclusive of self.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - list[DOMNode] -

    A list of nodes.

    TypeDescription
    -
    + + + + + list[DOMNode] + + +
    +

    A list of nodes.

    +
    + + + + +
    @@ -8076,22 +9258,22 @@

    - auto_refresh + auto_refresh + - property writable

    -
    auto_refresh: float | None
    +
    auto_refresh
     
    -
    - -

    Number of seconds between automatic refresh, or None for no automatic refresh.

    -
    +
    + +

    Number of seconds between automatic refresh, or None for no automatic refresh.

    +
    @@ -8100,39 +9282,44 @@

    - background_colors + background_colors + - property

    -
    background_colors: tuple[Color, Color]
    +
    background_colors
     
    -
    - -

    The background color and the color of the parent's background.

    +
    -

    Returns:

    - - - - - - - - +

    The background color and the color of the parent's background.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - tuple[Color, Color] -

    (<background color>, <color>)

    TypeDescription
    -
    + + + + + tuple[Color, Color] + + +
    +

    (<background color>, <color>)

    +
    + + + + +
    @@ -8141,39 +9328,44 @@

    - children + children + - property

    -
    children: Sequence['Widget']
    +
    children
     
    -
    - -

    A view on to the children.

    +
    -

    Returns:

    - - - - - - - - +

    A view on to the children.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Sequence['Widget'] -

    The node's children.

    TypeDescription
    -
    + + + + + Sequence['Widget'] + + +
    +

    The node's children.

    +
    + + + + +
    @@ -8182,22 +9374,22 @@

    - classes + classes + - - instance-attribute class-attribute + instance-attribute

    -
    classes = _ClassesDescriptor()
    +
    classes = _ClassesDescriptor()
     
    -
    - -

    CSS class names for this node.

    -
    +
    + +

    CSS class names for this node.

    +
    @@ -8206,39 +9398,44 @@

    - colors + colors + - property

    -
    colors: tuple[Color, Color, Color, Color]
    +
    colors
     
    -
    - -

    The widget's background and foreground colors, and the parent's background and foreground colors.

    +
    -

    Returns:

    - - - - - - - - +

    The widget's background and foreground colors, and the parent's background and foreground colors.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - tuple[Color, Color, Color, Color] -

    (<parent background>, <parent color>, <background>, <color>)

    TypeDescription
    -
    + + + + + tuple[Color, Color, Color, Color] + + +
    +

    (<parent background>, <parent color>, <background>, <color>)

    +
    + + + + +
    @@ -8247,21 +9444,21 @@

    - css_identifier + css_identifier + - property

    -
    css_identifier: str
    +
    css_identifier
     
    -
    - -

    A CSS selector that identifies this DOM node.

    -
    +
    + +

    A CSS selector that identifies this DOM node.

    +
    @@ -8270,39 +9467,44 @@

    - css_identifier_styled + css_identifier_styled + - property

    -
    css_identifier_styled: Text
    +
    css_identifier_styled
     
    -
    - -

    A syntax highlighted CSS identifier.

    +
    + +

    A syntax highlighted CSS identifier.

    + -

    Returns:

    - - - - - - - - +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Text -

    A Rich Text object.

    TypeDescription
    -
    + + + + + Text + + +
    +

    A Rich Text object.

    +
    + + + + +
    @@ -8311,39 +9513,44 @@

    - css_path_nodes + css_path_nodes + - property

    -
    css_path_nodes: list[DOMNode]
    +
    css_path_nodes
     
    -
    - -

    A list of nodes from the App to this node, forming a "path".

    +
    + +

    A list of nodes from the App to this node, forming a "path".

    + -

    Returns:

    - - - - - - - - +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - list[DOMNode] -

    A list of nodes, where the first item is the App, and the last is this node.

    TypeDescription
    -
    + + + + + list[DOMNode] + + +
    +

    A list of nodes, where the first item is the App, and the last is this node.

    +
    + + + + +
    @@ -8352,45 +9559,51 @@

    - css_tree + css_tree + - property

    -
    css_tree: Tree
    +
    css_tree
     
    -
    - -

    A Rich tree to display the DOM, annotated with the node's CSS.

    +
    + +

    A Rich tree to display the DOM, annotated with the node's CSS.

    Log this to visualize your app in the textual console.

    +
    Example
    self.log(self.css_tree)
     
    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Tree -

    A Tree renderable.

    TypeDescription
    -
    + + + + + Tree + + +
    +

    A Tree renderable.

    +
    + + + + +
    @@ -8399,28 +9612,29 @@

    - display + display + - property writable

    -
    display: bool
    +
    display
     
    -
    - -

    Should the DOM node be displayed?

    +
    + +

    Should the DOM node be displayed?

    May be set to a boolean to show or hide the node, or to any valid value for the display rule.

    +
    Example
    my_widget.display = False  # Hide my_widget
     
    -
    +
    @@ -8429,39 +9643,44 @@

    - displayed_children + displayed_children + - property

    -
    displayed_children: list[Widget]
    +
    displayed_children
     
    -
    - -

    The child nodes which will be displayed.

    +
    -

    Returns:

    - - - - - - - - +

    The child nodes which will be displayed.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - list[Widget] -

    A list of nodes.

    TypeDescription
    -
    + + + + + list[Widget] + + +
    +

    A list of nodes.

    +
    + + + + +
    @@ -8470,22 +9689,22 @@

    - id + id + - property writable

    -
    id: str | None
    +
    id
     
    -
    - -

    The ID of this node, or None if the node has no ID.

    -
    +
    + +

    The ID of this node, or None if the node has no ID.

    +
    @@ -8494,21 +9713,21 @@

    - is_modal + is_modal + - property

    -
    is_modal: bool
    +
    is_modal
     
    -
    - -

    Is the node a modal?

    -
    +
    + +

    Is the node a modal?

    +
    @@ -8517,21 +9736,21 @@

    - is_on_screen + is_on_screen + - property

    -
    is_on_screen: bool
    +
    is_on_screen
     
    -
    - -

    Check if the node was displayed in the last screen update.

    -
    +
    + +

    Check if the node was displayed in the last screen update.

    +
    @@ -8540,21 +9759,21 @@

    - name + name + - property

    -
    name: str | None
    +
    name
     
    -
    - -

    The name of the node.

    -
    +
    + +

    The name of the node.

    +
    @@ -8563,22 +9782,22 @@

    - parent + parent + - property

    -
    parent: DOMNode | None
    +
    parent
     
    -
    - -

    The parent node.

    +
    + +

    The parent node.

    All nodes have parent once added to the DOM, with the exception of the App which is the root node.

    -
    +
    @@ -8587,21 +9806,21 @@

    - pseudo_classes + pseudo_classes + - property

    -
    pseudo_classes: frozenset[str]
    +
    pseudo_classes
     
    -
    - -

    A (frozen) set of all pseudo classes.

    -
    +
    + +

    A (frozen) set of all pseudo classes.

    +
    @@ -8610,39 +9829,44 @@

    - rich_style + rich_style + - property

    -
    rich_style: Style
    +
    rich_style
     
    -
    - -

    Get a Rich Style object for this DOMNode.

    +
    -

    Returns:

    - - - - - - - - +

    Get a Rich Style object for this DOMNode.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Style -

    A Rich style.

    TypeDescription
    -
    + + + + + Style + + +
    +

    A Rich style.

    +
    + + + + +
    @@ -8651,57 +9875,67 @@

    - screen + screen + - property

    -
    screen: 'Screen[object]'
    +
    screen
     
    -
    - -

    The screen containing this node.

    +
    -

    Returns:

    - - - - - - - - +

    The screen containing this node.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - 'Screen[object]' -

    A screen object.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + 'Screen[object]' + +
    +

    A screen object.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - NoScreen -

    If this node isn't mounted (and has no screen).

    TypeDescription
    -
    + + + + + NoScreen + + +
    +

    If this node isn't mounted (and has no screen).

    +
    + + + + +
    @@ -8710,41 +9944,46 @@

    - text_style + text_style + - property

    -
    text_style: Style
    +
    text_style
     
    -
    - -

    Get the text style object.

    +
    + +

    Get the text style object.

    A widget's style is influenced by its parent. for instance if a parent is bold, then the child will also be bold.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Style -

    A Rich Style.

    TypeDescription
    -
    + + + + + Style + + +
    +

    A Rich Style.

    +
    + + + + +
    @@ -8753,45 +9992,51 @@

    - tree + tree + - property

    -
    tree: Tree
    +
    tree
     
    -
    - -

    A Rich tree to display the DOM.

    +
    + +

    A Rich tree to display the DOM.

    Log this to visualize your app in the textual console.

    +
    Example
    self.log(self.tree)
     
    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Tree -

    A Tree renderable.

    TypeDescription
    -
    + + + + + Tree + + +
    +

    A Tree renderable.

    +
    + + + + +
    @@ -8800,28 +10045,28 @@

    - visible + visible + - property writable

    -
    visible: bool
    +
    visible
     
    -
    - -

    Is this widget visible in the DOM?

    +
    + +

    Is this widget visible in the DOM?

    If a widget hasn't had its visibility set explicitly, then it inherits it from its DOM ancestors.

    This may be set explicitly to override inherited values. The valid values include the valid values for the visibility rule and the booleans True or False, to set the widget to be visible or invisible, respectively.

    When a node is invisible, Textual will reserve space for it, but won't display anything.

    -
    +
    @@ -8830,21 +10075,21 @@

    - workers + workers + - property

    -
    workers: WorkerManager
    +
    workers
     
    -
    - -

    The app's worker manager. Shortcut for self.app.workers.

    -
    +
    + +

    The app's worker manager. Shortcut for self.app.workers.

    +
    @@ -8853,316 +10098,372 @@

    -

    - action_toggle + action_toggle + - async

    -
    action_toggle(attribute_name)
    +
    action_toggle(attribute_name)
     
    -
    - -

    Toggle an attribute on the node.

    +
    + +

    Toggle an attribute on the node.

    Assumes the attribute is a bool.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    attribute_name - str -

    Name of the attribute.

    - required - NameTypeDescriptionDefault
    + + + + +

    attribute_name +

    + + str + + +
    +

    Name of the attribute.

    +
    + + + required + + + + -
    +
    -

    - add_class + add_class

    -
    add_class(*class_names, update=True)
    +
    add_class(*class_names, update=True)
     
    -
    - -

    Add class names to this Node.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Add class names to this Node.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    *class_names - str -

    CSS class names to add.

    - () -
    + - - - - + + + + - -
    update - bool -

    Also update styles.

    - True - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    *class_names +

    + str + +
    +

    CSS class names to add.

    +
    +
    + () +
    +

    update +

    + bool + +
    +

    Also update styles.

    +
    +
    + True +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    Self.

    TypeDescription
    + + + + + Self + + +
    +

    Self.

    +
    + + + + -
    +
    -

    - automatic_refresh + automatic_refresh

    -
    automatic_refresh()
    +
    automatic_refresh()
     
    -
    - -

    Perform an automatic refresh.

    +
    + +

    Perform an automatic refresh.

    This method is called when you set the auto_refresh attribute. You could implement this method if you want to perform additional work during an automatic refresh.

    -
    +
    -

    - check_action + check_action

    -
    check_action(action, parameters)
    +
    check_action(action, parameters)
     
    -
    - -

    Check whether an action is enabled.

    +
    + +

    Check whether an action is enabled.

    Implement this method to add logic for dynamic actions / bindings.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + + + + + + + + + + + + + + + + +
    action - str -

    The name of an action.

    - required - NameTypeDescriptionDefault
    +

    action +

    + str + +
    +

    The name of an action.

    +
    +
    + required +
    +

    parameters +

    + tuple[object, ...] + +
    +

    A tuple of any action parameters.

    +
    +
    + required +
    + + +

    Returns:

    + + - - - - + + - -
    parameters - tuple[object, ...] -

    A tuple of any action parameters.

    - required - TypeDescription
    - -

    Returns:

    - - - - - - - - - - - + + + - - -
    TypeDescription
    - bool | None -

    True if the action is enabled+visible, + +

    + bool | None + +
    +

    True if the action is enabled+visible, False if the action is disabled+hidden, -None if the action is disabled+visible (grayed out in footer)

    +None if the action is disabled+visible (grayed out in footer)

    +
    + + + + -
    +
    -

    - check_consume_key + check_consume_key

    -
    check_consume_key(key, character)
    +
    check_consume_key(key, character)
     
    -
    - -

    Check if the widget may consume the given key.

    +
    + +

    Check if the widget may consume the given key.

    This should be implemented in widgets that handle Key events and stop propagation (such as Input and TextArea).

    Implementing this method will hide key bindings from the footer and key panel that would be consumed by the focused widget.

    -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    key - str -

    A key identifier.

    - required -
    + - - - - + + + + - -
    character - str | None -

    A character associated with the key, or None if there isn't one.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    key +

    + str + +
    +

    A key identifier.

    +
    +
    + required +
    +

    character +

    + str | None + +
    +

    A character associated with the key, or None if there isn't one.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the widget may capture the key in its Key event handler, or False if it won't.

    TypeDescription
    + + + + + bool + + +
    +

    True if the widget may capture the key in its Key event handler, or False if it won't.

    +
    + + + + -
    +
    -

    - data_bind + data_bind

    -
    data_bind(*reactives, **bind_vars)
    +
    data_bind(*reactives, **bind_vars)
     
    -
    - -

    Bind reactive data so that changes to a reactive automatically change the reactive on another widget.

    +
    + +

    Bind reactive data so that changes to a reactive automatically change the reactive on another widget.

    Reactives may be given as positional arguments or keyword arguments. See the guide on data binding.

    +
    Example
    def compose(self) -> ComposeResult:
    @@ -9171,372 +10472,435 @@ 

    yield WorldClock("Asia/Tokyo").data_bind(WorldClockApp.time)

    -

    Raises:

    - - - - - - - - + +

    Raises:

    +
    TypeDescription
    + - - + + - -
    - ReactiveError -

    If the data wasn't bound.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + ReactiveError + +
    +

    If the data wasn't bound.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    Self.

    TypeDescription
    + + + + + Self + + +
    +

    Self.

    +
    + + + + -
    +
    -

    - get_component_styles + get_component_styles

    -
    get_component_styles(*names)
    +
    get_component_styles(*names)
     
    -
    - -

    Get a "component" styles object (must be defined in COMPONENT_CLASSES classvar).

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get a "component" styles object (must be defined in COMPONENT_CLASSES classvar).

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    names - str -

    Names of the components.

    - () - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    names +

    + str + +
    +

    Names of the components.

    +
    +
    + () +
    + + +

    Raises:

    + + - - + + - -
    - KeyError -

    If the component class doesn't exist.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + KeyError + +
    +

    If the component class doesn't exist.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - RenderStyles -

    A Styles object.

    TypeDescription
    + + + + + RenderStyles + + +
    +

    A Styles object.

    +
    + + + + -
    +
    -

    - get_pseudo_classes + get_pseudo_classes

    -
    get_pseudo_classes()
    +
    get_pseudo_classes()
     
    -
    - -

    Pseudo classes for a widget.

    +
    -

    Returns:

    - - - - - - - - +

    Pseudo classes for a widget.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - set[str] -

    Names of the pseudo classes.

    TypeDescription
    + + + + + set[str] + + +
    +

    Names of the pseudo classes.

    +
    + + + + -
    +
    -

    - has_class + has_class

    -
    has_class(*class_names)
    +
    has_class(*class_names)
     
    -
    - -

    Check if the Node has all the given class names.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Check if the Node has all the given class names.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    *class_names - str -

    CSS class names to check.

    - () - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    *class_names +

    + str + +
    +

    CSS class names to check.

    +
    +
    + () +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the node has all the given class names, otherwise False.

    TypeDescription
    + + + + + bool + + +
    +

    True if the node has all the given class names, otherwise False.

    +
    + + + + -
    +
    -

    - has_pseudo_class + has_pseudo_class

    -
    has_pseudo_class(class_name)
    +
    has_pseudo_class(class_name)
     
    -
    - -

    Check the node has the given pseudo class.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Check the node has the given pseudo class.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    class_name - str -

    The pseudo class to check for.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    class_name +

    + str + +
    +

    The pseudo class to check for.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the DOM node has the pseudo class, False if not.

    TypeDescription
    + + + + + bool + + +
    +

    True if the DOM node has the pseudo class, False if not.

    +
    + + + + -
    +
    -

    - has_pseudo_classes + has_pseudo_classes

    -
    has_pseudo_classes(class_names)
    +
    has_pseudo_classes(class_names)
     
    -
    - -

    Check the node has all the given pseudo classes.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Check the node has all the given pseudo classes.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    class_names - set[str] -

    Set of class names to check for.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    class_names +

    + set[str] + +
    +

    Set of class names to check for.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if all pseudo class names are present.

    TypeDescription
    + + + + + bool + + +
    +

    True if all pseudo class names are present.

    +
    + + + + -
    +
    -

    - mutate_reactive + mutate_reactive

    -
    mutate_reactive(reactive)
    +
    mutate_reactive(reactive)
     
    -
    - -

    Force an update to a mutable reactive.

    +
    + +

    Force an update to a mutable reactive.

    +
    Example
    self.reactive_name_list.append("Jessica")
     self.mutate_reactive(MyClass.reactive_name_list)
     
    -

    Textual will automatically detect when a reactive is set to a new value, but it is unable +

    Textual will automatically detect when a reactive is set to a new value, but it is unable to detect if a value is mutated (such as updating a list, dict, or attribute of an object). If you do wish to use a collection or other mutable object in a reactive, then you can call this method after your reactive is updated. This will ensure that all the reactive superpowers @@ -9546,1162 +10910,1471 @@

    This method will cause watchers to be called, even if the value hasn't changed.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    reactive - Reactive[ReactiveType] -

    A reactive property (use the class scope syntax, i.e. MyClass.my_reactive).

    - required - NameTypeDescriptionDefault
    + + + + +

    reactive +

    + + Reactive[ReactiveType] + + +
    +

    A reactive property (use the class scope syntax, i.e. MyClass.my_reactive).

    +
    + + + required + + + + -
    +
    -

    - notify_style_update + notify_style_update

    -
    notify_style_update()
    +
    notify_style_update()
     
    -
    - -

    Called after styles are updated.

    +
    + +

    Called after styles are updated.

    Implement this in a subclass if you want to clear any cached data when the CSS is reloaded.

    -
    +
    -

    - query + query

    -
    query(selector=None)
    +          
    +
    query(selector: str | None = None) -> DOMQuery[Widget]
    +
    +
    query(selector=None)
     
    -
    - -

    Query the DOM for children that match a selector or widget type.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Query the DOM for children that match a selector or widget type.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    selector - str | type[QueryType] | None -

    A CSS selector, widget type, or None for all nodes.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    selector +

    + str | type[QueryType] | None + +
    +

    A CSS selector, widget type, or None for all nodes.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - DOMQuery[Widget] | DOMQuery[QueryType] -

    A query object.

    TypeDescription
    + + + + + DOMQuery[Widget] | DOMQuery[QueryType] + + +
    +

    A query object.

    +
    + + + + -
    +
    -

    - query_children + query_children

    -
    query_children(selector=None)
    +          
    +
    query_children(
    +    selector: str | None = None,
    +) -> DOMQuery[Widget]
    +
    query_children(
    +    selector: type[QueryType],
    +) -> DOMQuery[QueryType]
    +
    +
    query_children(selector=None)
     
    -
    - -

    Query the DOM for the immediate children that match a selector or widget type.

    +
    + +

    Query the DOM for the immediate children that match a selector or widget type.

    Note that this will not return child widgets more than a single level deep. If you want to a query to potentially match all children in the widget tree, see query.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    selector - str | type[QueryType] | None -

    A CSS selector, widget type, or None for all nodes.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    selector +

    + str | type[QueryType] | None + +
    +

    A CSS selector, widget type, or None for all nodes.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - DOMQuery[Widget] | DOMQuery[QueryType] -

    A query object.

    TypeDescription
    + + + + + DOMQuery[Widget] | DOMQuery[QueryType] + + +
    +

    A query object.

    +
    + + + + -
    +
    -

    - query_exactly_one + query_exactly_one

    -
    query_exactly_one(selector, expect_type=None)
    +          
    +
    query_exactly_one(selector: str) -> Widget
    +
    query_exactly_one(selector: type[QueryType]) -> QueryType
    +
    query_exactly_one(
    +    selector: str, expect_type: type[QueryType]
    +) -> QueryType
    +
    +
    query_exactly_one(selector, expect_type=None)
     
    -
    - -

    Get a widget from this widget's children that matches a selector or widget type.

    +
    + +

    Get a widget from this widget's children that matches a selector or widget type.

    Note

    This method is similar to query_one. The only difference is that it will raise TooManyMatches if there is more than a single match.

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescriptionDefault
    selector - str | type[QueryType] -

    A selector or widget type.

    - required -
    expect_type - type[QueryType] | None -

    Require the object be of the supplied type, or None for any type.

    - None -
    - -

    Raises:

    - - - - - - - - - - - - + +

    Parameters:

    +
    TypeDescription
    - WrongType -

    If the wrong type was found.

    + - - + + + + + + + + + + + + + + + + + + + +
    - NoMatches -

    If no node matches the query.

    NameTypeDescriptionDefault
    +

    selector +

    + str | type[QueryType] + +
    +

    A selector or widget type.

    +
    +
    + required +
    +

    expect_type +

    + type[QueryType] | None + +
    +

    Require the object be of the supplied type, or None for any type.

    +
    +
    + None +
    + + +

    Raises:

    + + - - + + - -
    - TooManyMatches -

    If there is more than one matching node in the query (and exactly_one==True).

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    + WrongType + +
    +

    If the wrong type was found.

    +
    +
    + NoMatches + +
    +

    If no node matches the query.

    +
    +
    + TooManyMatches + +
    +

    If there is more than one matching node in the query (and exactly_one==True).

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - QueryType | Widget -

    A widget matching the selector.

    TypeDescription
    + + + + + QueryType | Widget + + +
    +

    A widget matching the selector.

    +
    + + + + -
    +
    -

    - query_one + query_one

    -
    query_one(selector, expect_type=None)
    +          
    +
    query_one(selector: str) -> Widget
    +
    query_one(selector: type[QueryType]) -> QueryType
    +
    query_one(
    +    selector: str, expect_type: type[QueryType]
    +) -> QueryType
    +
    +
    query_one(selector, expect_type=None)
     
    -
    - -

    Get a widget from this widget's children that matches a selector or widget type.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescriptionDefault
    selector - str | type[QueryType] -

    A selector or widget type.

    - required -
    expect_type - type[QueryType] | None -

    Require the object be of the supplied type, or None for any type.

    - None -
    - -

    Raises:

    - - - - - - - - +
    + +

    Get a widget from this widget's children that matches a selector or widget type.

    + + +

    Parameters:

    +
    TypeDescription
    + - - + + + + + + + + + + + + + + + + + + + +
    - WrongType -

    If the wrong type was found.

    NameTypeDescriptionDefault
    +

    selector +

    + str | type[QueryType] + +
    +

    A selector or widget type.

    +
    +
    + required +
    +

    expect_type +

    + type[QueryType] | None + +
    +

    Require the object be of the supplied type, or None for any type.

    +
    +
    + None +
    + + +

    Raises:

    + + - - + + - -
    - NoMatches -

    If no node matches the query.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + +
    TypeDescription
    + WrongType + +
    +

    If the wrong type was found.

    +
    +
    + NoMatches + +
    +

    If no node matches the query.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - QueryType | Widget -

    A widget matching the selector.

    TypeDescription
    + + + + + QueryType | Widget + + +
    +

    A widget matching the selector.

    +
    + + + + -
    +
    -

    - refresh_bindings + refresh_bindings

    -
    refresh_bindings()
    +
    refresh_bindings()
     
    -
    - -

    Call to prompt widgets such as the Footer to update +

    + +

    Call to prompt widgets such as the Footer to update the display of key bindings.

    See actions for how to use this method.

    -
    +
    -

    - remove_class + remove_class

    -
    remove_class(*class_names, update=True)
    +
    remove_class(*class_names, update=True)
     
    -
    - -

    Remove class names from this Node.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Remove class names from this Node.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    *class_names - str -

    CSS class names to remove.

    - () -
    + - - - - + + + + - -
    update - bool -

    Also update styles.

    - True - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    *class_names +

    + str + +
    +

    CSS class names to remove.

    +
    +
    + () +
    +

    update +

    + bool + +
    +

    Also update styles.

    +
    +
    + True +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    Self.

    TypeDescription
    + + + + + Self + + +
    +

    Self.

    +
    + + + + -
    +
    -

    - reset_styles + reset_styles

    -
    reset_styles()
    +
    reset_styles()
     
    -
    - -

    Reset styles back to their initial state.

    +
    -
    +

    Reset styles back to their initial state.

    + +
    -

    - run_worker + run_worker

    -
    run_worker(
    -    work,
    -    name="",
    -    group="default",
    -    description="",
    -    exit_on_error=True,
    -    start=True,
    -    exclusive=False,
    -    thread=False,
    +
    run_worker(
    +    work,
    +    name="",
    +    group="default",
    +    description="",
    +    exit_on_error=True,
    +    start=True,
    +    exclusive=False,
    +    thread=False,
     )
     
    -
    - -

    Run work in a worker.

    +
    + +

    Run work in a worker.

    A worker runs a function, coroutine, or awaitable, in the background as an async task or as a thread.

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    work - WorkType[ResultType] -

    A function, async function, or an awaitable object to run in a worker.

    - required -
    name - str | None -

    A short string to identify the worker (in logs and debugging).

    - '' -
    group - str -

    A short string to identify a group of workers.

    - 'default' -
    description - str -

    A longer string to store longer information on the worker.

    - '' -
    exit_on_error - bool -

    Exit the app if the worker raises an error. Set to False to suppress exceptions.

    - True -
    start - bool -

    Start the worker immediately.

    - True -
    exclusive - bool -

    Cancel all workers in the same group.

    - False -
    + - - - - + + + + - -
    thread - bool -

    Mark the worker as a thread worker.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    work +

    + WorkType[ResultType] + +
    +

    A function, async function, or an awaitable object to run in a worker.

    +
    +
    + required +
    +

    name +

    + str | None + +
    +

    A short string to identify the worker (in logs and debugging).

    +
    +
    + '' +
    +

    group +

    + str + +
    +

    A short string to identify a group of workers.

    +
    +
    + 'default' +
    +

    description +

    + str + +
    +

    A longer string to store longer information on the worker.

    +
    +
    + '' +
    +

    exit_on_error +

    + bool + +
    +

    Exit the app if the worker raises an error. Set to False to suppress exceptions.

    +
    +
    + True +
    +

    start +

    + bool + +
    +

    Start the worker immediately.

    +
    +
    + True +
    +

    exclusive +

    + bool + +
    +

    Cancel all workers in the same group.

    +
    +
    + False +
    +

    thread +

    + bool + +
    +

    Mark the worker as a thread worker.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Worker[ResultType] -

    New Worker instance.

    TypeDescription
    + + + + + Worker[ResultType] + + +
    +

    New Worker instance.

    +
    + + + + -
    +
    -

    - set_class + set_class

    -
    set_class(add, *class_names, update=True)
    +
    set_class(add, *class_names, update=True)
     
    -
    - -

    Add or remove class(es) based on a condition.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Add or remove class(es) based on a condition.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    add - bool -

    Add the classes if True, otherwise remove them.

    - required -
    + - - - - + + + + - -
    update - bool -

    Also update styles.

    - True - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    add +

    + bool + +
    +

    Add the classes if True, otherwise remove them.

    +
    +
    + required +
    +

    update +

    + bool + +
    +

    Also update styles.

    +
    +
    + True +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    Self.

    TypeDescription
    + + + + + Self + + +
    +

    Self.

    +
    + + + + -
    +
    -

    - set_classes + set_classes

    -
    set_classes(classes)
    +
    set_classes(classes)
     
    -
    - -

    Replace all classes.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Replace all classes.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    classes - str | Iterable[str] -

    A string containing space separated classes, or an -iterable of class names.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    classes +

    + str | Iterable[str] + +
    +

    A string containing space separated classes, or an +iterable of class names.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    Self.

    TypeDescription
    + + + + + Self + + +
    +

    Self.

    +
    + + + + -
    +
    -

    - set_reactive + set_reactive

    -
    set_reactive(reactive, value)
    +
    set_reactive(reactive, value)
     
    -
    - -

    Sets a reactive value without invoking validators or watchers.

    +
    + +

    Sets a reactive value without invoking validators or watchers.

    +
    Example
    self.set_reactive(App.dark_mode, True)
     
    -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    reactive - Reactive[ReactiveType] -

    A reactive property (use the class scope syntax, i.e. MyClass.my_reactive).

    - required -
    + - - - - + + + + - -
    value - ReactiveType -

    New value of reactive.

    - required - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    reactive +

    + Reactive[ReactiveType] + +
    +

    A reactive property (use the class scope syntax, i.e. MyClass.my_reactive).

    +
    +
    + required +
    +

    value +

    + ReactiveType + +
    +

    New value of reactive.

    +
    +
    + required +
    + + +

    Raises:

    + + - - + + - -
    - AttributeError -

    If the first argument is not a reactive.

    TypeDescription
    + + + + + AttributeError + + +
    +

    If the first argument is not a reactive.

    +
    + + + + -
    +
    -

    - set_styles + set_styles

    -
    set_styles(css=None, **update_styles)
    +
    set_styles(css=None, **update_styles)
     
    -
    - -

    Set custom styles on this object.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Set custom styles on this object.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    css - str | None -

    Styles in CSS format.

    - None -
    + - - - - + + + + - -
    update_styles - Any -

    Keyword arguments map style names onto style values.

    - {} - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    css +

    + str | None + +
    +

    Styles in CSS format.

    +
    +
    + None +
    +

    update_styles +

    + Any + +
    +

    Keyword arguments map style names onto style values.

    +
    +
    + {} +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    Self.

    TypeDescription
    + + + + + Self + + +
    +

    Self.

    +
    + + + + -
    +
    -

    - sort_children + sort_children

    -
    sort_children(*, key=None, reverse=False)
    +
    sort_children(*, key=None, reverse=False)
     
    -
    - -

    Sort child widgets with an optional key function.

    +
    + +

    Sort child widgets with an optional key function.

    If key is not provided then widgets will be sorted in the order they are constructed.

    +
    Example
    # Sort widgets by name
     screen.sort_children(key=lambda widget: widget.name or "")
     
    -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    key - Callable[[Widget], SupportsRichComparison] | None -

    A callable which accepts a widget and returns something that can be sorted, -or None to sort without a key function.

    - None -
    + - - - - + + + + - -
    reverse - bool -

    Sort in descending order.

    - False - NameTypeDescriptionDefault
    + + + + +

    key +

    + + Callable[[Widget], SupportsRichComparison] | None + + +
    +

    A callable which accepts a widget and returns something that can be sorted, +or None to sort without a key function.

    +
    + + + None + + + + +

    reverse +

    + + bool + + +
    +

    Sort in descending order.

    +
    + + + False + + + + -
    +
    -

    - toggle_class + toggle_class

    -
    toggle_class(*class_names)
    +
    toggle_class(*class_names)
     
    -
    - -

    Toggle class names on this Node.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Toggle class names on this Node.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    *class_names - str -

    CSS class names to toggle.

    - () - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    *class_names +

    + str + +
    +

    CSS class names to toggle.

    +
    +
    + () +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    Self.

    TypeDescription
    + + + + + Self + + +
    +

    Self.

    +
    + + + + -
    +
    -

    - walk_children + walk_children

    -
    walk_children(
    -    filter_type=None,
    +          
    +
    walk_children(
    +    filter_type: type[WalkType],
    +    *,
    +    with_self: bool = False,
    +    method: WalkMethod = "depth",
    +    reverse: bool = False
    +) -> list[WalkType]
    +
    walk_children(
    +    *,
    +    with_self: bool = False,
    +    method: WalkMethod = "depth",
    +    reverse: bool = False
    +) -> list[DOMNode]
    +
    +
    walk_children(
    +    filter_type=None,
         *,
    -    with_self=False,
    -    method="depth",
    -    reverse=False
    +    with_self=False,
    +    method="depth",
    +    reverse=False
     )
     
    -
    - -

    Walk the subtree rooted at this node, and return every descendant encountered in a list.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Walk the subtree rooted at this node, and return every descendant encountered in a list.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    filter_type - type[WalkType] | None -

    Filter only this type, or None for no filter.

    - None -
    with_self - bool -

    Also yield self in addition to descendants.

    - False -
    method - WalkMethod -

    One of "depth" or "breadth".

    - 'depth' -
    + - - - - + + + + - -
    reverse - bool -

    Reverse the order (bottom up).

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    filter_type +

    + type[WalkType] | None + +
    +

    Filter only this type, or None for no filter.

    +
    +
    + None +
    +

    with_self +

    + bool + +
    +

    Also yield self in addition to descendants.

    +
    +
    + False +
    +

    method +

    + WalkMethod + +
    +

    One of "depth" or "breadth".

    +
    +
    + 'depth' +
    +

    reverse +

    + bool + +
    +

    Reverse the order (bottom up).

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - list[DOMNode] | list[WalkType] -

    A list of nodes.

    TypeDescription
    + + + + + list[DOMNode] | list[WalkType] + + +
    +

    A list of nodes.

    +
    + + + + -
    +
    -

    - watch + watch

    -
    watch(obj, attribute_name, callback, init=True)
    +
     
    -  
    - -

    Watches for modifications to reactive attributes on another object.

    +
    + +

    Watches for modifications to reactive attributes on another object.

    +
    Example @@ -10712,61 +12385,86 @@

    self.watch(self.app, "dark", self.on_dark_change, init=False)

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    obj - DOMNode -

    Object containing attribute to watch.

    - required -
    attribute_name - str -

    Attribute to watch.

    - required -
    callback - WatchCallbackType -

    A callback to run when attribute changes.

    - required -
    + - - - - + + + + - -
    init - bool -

    Check watchers on first call.

    - True - NameTypeDescriptionDefault
    + + + + +

    obj +

    + + DOMNode + + +
    +

    Object containing attribute to watch.

    +
    + + + required + + + + +

    attribute_name +

    + + str + + +
    +

    Attribute to watch.

    +
    + + + required + + + + +

    callback +

    + + WatchCallbackType + + +
    +

    A callback to run when attribute changes.

    +
    + + + required + + + + +

    init +

    + + bool + + +
    +

    Check watchers on first call.

    +
    + + + True + + + + -
    +
    @@ -10774,7 +12472,7 @@

    -
    +
    @@ -10783,22 +12481,27 @@

    - NoScreen + NoScreen

    -
    -

    - Bases: DOMError

    +
    +

    + Bases: DOMError

    + + + +

    Raised when the node has no associated screen.

    - -

    Raised when the node has no associated screen.

    -
    + + + +
    @@ -10806,54 +12509,66 @@

    -

    - check_identifiers + check_identifiers

    -
    check_identifiers(description, *names)
    +
    check_identifiers(description, *names)
     
    -
    - -

    Validate identifier and raise an error if it fails.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Validate identifier and raise an error if it fails.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    description - str -

    Description of where identifier is used for error message.

    - required -
    + - - - - + + + + - -
    *names - str -

    Identifiers to check.

    - () - NameTypeDescriptionDefault
    + + + + +

    description +

    + + str + + +
    +

    Description of where identifier is used for error message.

    +
    + + + required + + + + +

    *names +

    + + str + + +
    +

    Identifiers to check.

    +
    + + + () + + + + -
    +
    @@ -10861,7 +12576,7 @@

    -
    +
    diff --git a/api/errors/index.html b/api/errors/index.html index 685a6b3453..cc360d2f34 100644 --- a/api/errors/index.html +++ b/api/errors/index.html @@ -5229,7 +5229,7 @@
  • - textual.errors +  errors @@ -5238,7 +5238,7 @@
  • - DuplicateKeyHandlers +  DuplicateKeyHandlers @@ -5247,7 +5247,7 @@
  • - NoWidget +  NoWidget @@ -5256,7 +5256,7 @@
  • - RenderError +  RenderError @@ -5265,7 +5265,7 @@
  • - TextualError +  TextualError @@ -6450,7 +6450,7 @@
  • - textual.errors +  errors @@ -6459,7 +6459,7 @@
  • - DuplicateKeyHandlers +  DuplicateKeyHandlers @@ -6468,7 +6468,7 @@
  • - NoWidget +  NoWidget @@ -6477,7 +6477,7 @@
  • - RenderError +  RenderError @@ -6486,7 +6486,7 @@
  • - TextualError +  TextualError @@ -6515,12 +6515,18 @@

    textual.errors

    + -
    - -

    General exception classes.

    +
    + +

    General exception classes.

    + + + + + + -
    @@ -6536,24 +6542,29 @@

    textual.errors

    - DuplicateKeyHandlers + DuplicateKeyHandlers

    -
    -

    - Bases: TextualError

    +
    +

    + Bases: TextualError

    - -

    More than one handler for a single key press.

    + + +

    More than one handler for a single key press.

    For example, if the handlers key_ctrl_i and key_tab were defined on the same widget, then this error would be raised.

    -
    + + + + +
    @@ -6562,22 +6573,27 @@

    - NoWidget + NoWidget

    -
    -

    - Bases: TextualError

    +
    +

    + Bases: TextualError

    + + + +

    Specified widget was not found.

    - -

    Specified widget was not found.

    -
    + + + +
    @@ -6586,22 +6602,27 @@

    - RenderError + RenderError

    -
    -

    - Bases: TextualError

    +
    +

    + Bases: TextualError

    - -

    An object could not be rendered.

    +

    An object could not be rendered.

    -
    + + + + + + +
    @@ -6610,22 +6631,27 @@

    - TextualError + TextualError

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    + + + +

    Base class for Textual errors.

    - -

    Base class for Textual errors.

    -
    + + + +
    @@ -6634,7 +6660,7 @@

  • -
    +

    diff --git a/api/events/index.html b/api/events/index.html index 2b0aaaba9e..a8cc6c12be 100644 --- a/api/events/index.html +++ b/api/events/index.html @@ -5208,7 +5208,7 @@
  • - textual.events +  events @@ -5217,7 +5217,7 @@
  • - AppBlur +  AppBlur @@ -5226,7 +5226,7 @@
  • - AppFocus +  AppFocus @@ -5235,7 +5235,7 @@
  • - Blur +  Blur @@ -5244,7 +5244,7 @@
  • - Callback +  Callback @@ -5253,7 +5253,7 @@
  • - Click +  Click @@ -5262,7 +5262,7 @@
  • - Compose +  Compose @@ -5271,7 +5271,7 @@
  • - CursorPosition +  CursorPosition @@ -5280,17 +5280,17 @@
  • - DeliveryComplete +  DeliveryComplete -
  • +
    DeliveryComplete(key, path=None, name=None)
    +
    + +
    +

    + Bases: Event

    + + + +

    Sent to App when a file has been delivered.

    + + -
    -

    - Bases: Event

    - -

    Sent to App when a file has been delivered.

    -
    @@ -8338,22 +8923,22 @@

    - key + key + - instance-attribute

    -
    key: str
    +
    key
     
    -
    - -

    The delivery key associated with the delivery.

    +
    + +

    The delivery key associated with the delivery.

    This is the same key that was returned by App.deliver_text/App.deliver_binary.

    -
    +
    @@ -8362,22 +8947,22 @@

    - name + name + - - instance-attribute class-attribute + instance-attribute

    -
    name: str | None = None
    +
    name = None
     
    -
    - -

    Optional name returned to the app to identify the download.

    -
    +
    + +

    Optional name returned to the app to identify the download.

    +
    @@ -8386,23 +8971,23 @@

    - path + path + - - instance-attribute class-attribute + instance-attribute

    -
    path: Path | None = None
    +
    path = None
     
    -
    - -

    The path where the file was saved, or None if the path is not available, for +

    + +

    The path where the file was saved, or None if the path is not available, for example if the file was delivered via web browser.

    -
    +
    @@ -8412,7 +8997,7 @@

    -
    +
    @@ -8421,26 +9006,32 @@

    - DeliveryFailed + DeliveryFailed + - dataclass

    +
    DeliveryFailed(key, exception, name=None)
    +
    + +
    +

    + Bases: Event

    + + + +

    Sent to App when a file delivery fails.

    + + -
    -

    - Bases: Event

    - -

    Sent to App when a file delivery fails.

    -
    @@ -8455,21 +9046,21 @@

    - exception + exception + - instance-attribute

    -
    exception: BaseException
    +
    exception
     
    -
    - -

    The exception that was raised during the delivery.

    -
    +
    + +

    The exception that was raised during the delivery.

    +
    @@ -8478,21 +9069,21 @@

    - key + key + - instance-attribute

    -
    key: str
    +
    key
     
    -
    - -

    The delivery key associated with the delivery.

    -
    +
    + +

    The delivery key associated with the delivery.

    +
    @@ -8501,22 +9092,22 @@

    - name + name + - - instance-attribute class-attribute + instance-attribute

    -
    name: str | None = None
    +
    name = None
     
    -
    - -

    Optional name returned to the app to identify the download.

    -
    +
    + +

    Optional name returned to the app to identify the download.

    +
    @@ -8526,7 +9117,7 @@

    -
    +
    @@ -8535,22 +9126,24 @@

    - DescendantBlur + DescendantBlur + - dataclass

    +
    DescendantBlur(widget)
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent when a child widget is blurred.

    + +

    Sent when a child widget is blurred.

    • Bubbles
    • Verbose
    • @@ -8558,7 +9151,11 @@

      - + + + + +
      @@ -8573,21 +9170,21 @@

      - control + control + - property

      -
      control: Widget
      +
      control
       
      -
      - -

      The widget that was blurred (alias of widget).

      -
      +
      + +

      The widget that was blurred (alias of widget).

      +
      @@ -8596,21 +9193,21 @@

      - widget + widget + - instance-attribute

      -
      widget: Widget
      +
      widget
       
      -
      - -

      The widget that was blurred.

      -
      +
      + +

      The widget that was blurred.

      +
      @@ -8620,7 +9217,7 @@

      -

    +
    @@ -8629,22 +9226,24 @@

    - DescendantFocus + DescendantFocus + - dataclass

    +
    DescendantFocus(widget)
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent when a child widget is focussed.

    + +

    Sent when a child widget is focussed.

    • Bubbles
    • Verbose
    • @@ -8652,7 +9251,11 @@

      - + + + + +
      @@ -8667,21 +9270,21 @@

      - control + control + - property

      -
      control: Widget
      +
      control
       
      -
      - -

      The widget that was focused (alias of widget).

      -
      +
      + +

      The widget that was focused (alias of widget).

      +
      @@ -8690,21 +9293,21 @@

      - widget + widget + - instance-attribute

      -
      widget: Widget
      +
      widget
       
      -
      - -

      The widget that was focused.

      -
      +
      + +

      The widget that was focused.

      +
      @@ -8714,7 +9317,7 @@

      -

    +
    @@ -8723,19 +9326,20 @@

    - Enter + Enter

    -
    Enter(node)
    +
    Enter(node)
     
    -
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Sent when the mouse is moved over a widget.

    + + +

    Sent when the mouse is moved over a widget.

    Note that this event bubbles, so a widget may receive this event when the mouse moves over a child widget. Check the node attribute for the widget directly under the mouse.

    @@ -8746,7 +9350,11 @@

    - + + + + +
    @@ -8761,21 +9369,21 @@

    - node + node + - instance-attribute

    -
    node = node
    +
    node = node
     
    -
    - -

    The node directly under the mouse.

    -
    +
    + +

    The node directly under the mouse.

    +
    @@ -8785,7 +9393,7 @@

    -

    +
    @@ -8794,23 +9402,45 @@

    - Event + Event

    +
    Event()
    +
    + +
    +

    + Bases: Message

    + + + +

    The base class for all events.

    + + + + + + + + + +
    + + + + + -
    -

    - Bases: Message

    - -

    The base class for all events.

    +
    +
    @@ -8818,116 +9448,204 @@

    - Focus + Focus

    +
    Focus()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent when a widget is focussed.

    + +

    Sent when a widget is focussed.

    +
      +
    • Bubbles
    • +
    • Verbose
    • +
    + + + + + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + +
    + + + +

    + Hide + + +

    +
    Hide()
    +
    + +
    +

    + Bases: Event

    + + + +

    Sent when a widget has been hidden.

    • Bubbles
    • Verbose
    +

    Sent when any of the following conditions apply:

    +
      +
    • The widget is removed from the DOM.
    • +
    • The widget is no longer displayed because it has been scrolled or clipped from the terminal or its container.
    • +
    • The widget has its display attribute set to False.
    • +
    • The widget's display style is set to "none".
    • +
    + + + + + + + + + +
    + + + + + + + +
    -
    +
    + +
    + +
    + + + +

    + Idle + + +

    +
    Idle()
    +
    + +
    +

    + Bases: Event

    + + + +

    Sent when there are no more items in the message queue.

    +

    This is a pseudo-event in that it is created by the Textual system and doesn't go +through the usual message queue.

    +
      +
    • Bubbles
    • +
    • Verbose
    • +
    + + + + + + + + -
    +
    -

    - Hide -

    -
    -

    - Bases: Event

    - -

    Sent when a widget has been hidden.

    -
      -
    • Bubbles
    • -
    • Verbose
    • -
    -

    Sent when any of the following conditions apply:

    -
      -
    • The widget is removed from the DOM.
    • -
    • The widget is no longer displayed because it has been scrolled or clipped from the terminal or its container.
    • -
    • The widget has its display attribute set to False.
    • -
    • The widget's display style is set to "none".
    • -
    +
    +
    -

    - Idle +

    + InputEvent -

    + +
    InputEvent()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent when there are no more items in the message queue.

    -

    This is a pseudo-event in that it is created by the Textual system and doesn't go -through the usual message queue.

    -
      -
    • Bubbles
    • -
    • Verbose
    • -
    +

    Base class for input events.

    -
    -
    -
    -

    - InputEvent -

    +
    + + + + + -
    -

    - Bases: Event

    - -

    Base class for input events.

    +
    +
    @@ -8935,61 +9653,79 @@

    - Key + Key

    -
    Key(key, character)
    +
    Key(key, character)
     
    -
    -

    - Bases: InputEvent

    +
    +

    + Bases: InputEvent

    - -

    Sent when the user hits a key on the keyboard.

    + + +

    Sent when the user hits a key on the keyboard.

    • Bubbles
    • Verbose
    -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    key - str -

    The key that was pressed.

    - required -
    + - - - - + + + + - -
    character - str | None -

    A printable character or None if it is not printable.

    - required - NameTypeDescriptionDefault
    + + + + +

    key +

    + + str + + +
    +

    The key that was pressed.

    +
    + + + required + + + + +

    character +

    + + str | None + + +
    +

    A printable character or None if it is not printable.

    +
    + + + required + + + + + + + + + -
    @@ -9004,21 +9740,21 @@

    - aliases + aliases + - instance-attribute

    -
    aliases: list[str] = _get_key_aliases(key)
    +
    aliases = _get_key_aliases(key)
     
    -
    - -

    The aliases for the key, including the key itself.

    -
    +
    + +

    The aliases for the key, including the key itself.

    +
    @@ -9027,25 +9763,25 @@

    - character + character + - instance-attribute

    -
    character = (
    -    key
    -    if len(key) == 1
    -    else None if character is None else character
    +
    character = (
    +    key
    +    if len(key) == 1
    +    else None if character is None else character
     )
     
    -
    - -

    A printable character or None if it is not printable.

    -
    +
    + +

    A printable character or None if it is not printable.

    +
    @@ -9054,39 +9790,44 @@

    - is_printable + is_printable + - property

    -
    is_printable: bool
    +
    is_printable
     
    -
    - -

    Check if the key is printable (produces a unicode character).

    +
    + +

    Check if the key is printable (produces a unicode character).

    + -

    Returns:

    - - - - - - - - +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - bool -

    True if the key is printable.

    TypeDescription
    -
    + + + + + bool + + +
    +

    True if the key is printable.

    +
    + + + + +
    @@ -9095,21 +9836,21 @@

    - key + key + - instance-attribute

    -
    key = key
    +
    key = key
     
    -
    - -

    The key that was pressed.

    -
    +
    + +

    The key that was pressed.

    +
    @@ -9118,21 +9859,21 @@

    - name + name + - property

    -
    name: str
    +
    name
     
    -
    - -

    Name of a key suitable for use as a Python identifier.

    -
    +
    + +

    Name of a key suitable for use as a Python identifier.

    +
    @@ -9141,21 +9882,21 @@

    - name_aliases + name_aliases + - property

    -
    name_aliases: list[str]
    +
    name_aliases
     
    -
    - -

    The corresponding name for every alias in aliases list.

    -
    +
    + +

    The corresponding name for every alias in aliases list.

    +
    @@ -9165,7 +9906,7 @@

    -
    +
    @@ -9174,19 +9915,20 @@

    - Leave + Leave

    -
    Leave(node)
    +
    Leave(node)
     
    -
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Sent when the mouse is moved away from a widget, or if a widget is + + +

    Sent when the mouse is moved away from a widget, or if a widget is programmatically disabled while hovered.

    Note that this widget bubbles, so a widget may receive Leave events for any child widgets. Check the node parameter for the original widget that was previously under the mouse.

    @@ -9197,7 +9939,11 @@

    - + + + + +
    @@ -9212,21 +9958,21 @@

    - node + node + - instance-attribute

    -
    node = node
    +
    node = node
     
    -
    - -

    The node that was previously directly under the mouse.

    -
    +
    + +

    The node that was previously directly under the mouse.

    +
    @@ -9236,7 +9982,7 @@

    -

    +
    @@ -9245,18 +9991,20 @@

    - Load + Load

    +
    Load()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent when the App is running but before the terminal is in application mode.

    + +

    Sent when the App is running but before the terminal is in application mode.

    Use this event to run any setup that doesn't require any visuals such as loading configuration and binding keys.

      @@ -9266,8 +10014,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -9275,18 +10043,20 @@

    - Mount + Mount

    +
    Mount()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent when a widget is mounted and may receive messages.

    + +

    Sent when a widget is mounted and may receive messages.

    • Bubbles
    • Verbose
    • @@ -9294,8 +10064,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -9303,52 +10093,64 @@

    - MouseCapture + MouseCapture

    -
    MouseCapture(mouse_position)
    +
    MouseCapture(mouse_position)
     
    -
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Sent when the mouse has been captured.

    + + +

    Sent when the mouse has been captured.

    • Bubbles
    • Verbose

    When a mouse has been captured, all further mouse events will be sent to the capturing widget.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    mouse_position - Offset -

    The position of the mouse when captured.

    - required - NameTypeDescriptionDefault
    + + + + +

    mouse_position +

    + + Offset + + +
    +

    The position of the mouse when captured.

    +
    + + + required + + + + + + + + + -
    @@ -9363,21 +10165,21 @@

    - mouse_position + mouse_position + - instance-attribute

    -
    mouse_position = mouse_position
    +
    mouse_position = mouse_position
     
    -
    - -

    The position of the mouse when captured.

    -
    +
    + +

    The position of the mouse when captured.

    +
    @@ -9387,7 +10189,7 @@

    -
    +
    @@ -9396,18 +10198,32 @@

    - MouseDown + MouseDown

    +
    MouseDown(
    +    x,
    +    y,
    +    delta_x,
    +    delta_y,
    +    button,
    +    shift,
    +    meta,
    +    ctrl,
    +    screen_x=None,
    +    screen_y=None,
    +    style=None,
    +)
    +
    +
    +

    + Bases: MouseEvent

    -
    -

    - Bases: MouseEvent

    - -

    Sent when a mouse button is pressed.

    + +

    Sent when a mouse button is pressed.

    • Bubbles
    • Verbose
    • @@ -9415,8 +10231,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -9424,163 +10260,235 @@

    - MouseEvent + MouseEvent

    -
    MouseEvent(
    -    x,
    -    y,
    -    delta_x,
    -    delta_y,
    -    button,
    -    shift,
    -    meta,
    -    ctrl,
    -    screen_x=None,
    -    screen_y=None,
    -    style=None,
    +
    MouseEvent(
    +    x,
    +    y,
    +    delta_x,
    +    delta_y,
    +    button,
    +    shift,
    +    meta,
    +    ctrl,
    +    screen_x=None,
    +    screen_y=None,
    +    style=None,
     )
     
    -
    -

    - Bases: InputEvent

    +
    +

    + Bases: InputEvent

    - -

    Sent in response to a mouse event.

    + + +

    Sent in response to a mouse event.

    • Bubbles
    • Verbose
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    x - int -

    The relative x coordinate.

    - required -
    y - int -

    The relative y coordinate.

    - required -
    delta_x - int -

    Change in x since the last message.

    - required -
    delta_y - int -

    Change in y since the last message.

    - required -
    button - int -

    Indexed of the pressed button.

    - required -
    shift - bool -

    True if the shift key is pressed.

    - required -
    meta - bool -

    True if the meta key is pressed.

    - required -
    ctrl - bool -

    True if the ctrl key is pressed.

    - required -
    screen_x - int | None -

    The absolute x coordinate.

    - None -
    screen_y - int | None -

    The absolute y coordinate.

    - None -
    + - - - - + + + + - -
    style - Style | None -

    The Rich Style under the mouse cursor.

    - None - NameTypeDescriptionDefault
    + + + + +

    x +

    + + int + + +
    +

    The relative x coordinate.

    +
    + + + required + + + + +

    y +

    + + int + + +
    +

    The relative y coordinate.

    +
    + + + required + + + + +

    delta_x +

    + + int + + +
    +

    Change in x since the last message.

    +
    + + + required + + + + +

    delta_y +

    + + int + + +
    +

    Change in y since the last message.

    +
    + + + required + + + + +

    button +

    + + int + + +
    +

    Indexed of the pressed button.

    +
    + + + required + + + + +

    shift +

    + + bool + + +
    +

    True if the shift key is pressed.

    +
    + + + required + + + + +

    meta +

    + + bool + + +
    +

    True if the meta key is pressed.

    +
    + + + required + + + + +

    ctrl +

    + + bool + + +
    +

    True if the ctrl key is pressed.

    +
    + + + required + + + + +

    screen_x +

    + + int | None + + +
    +

    The absolute x coordinate.

    +
    + + + None + + + + +

    screen_y +

    + + int | None + + +
    +

    The absolute y coordinate.

    +
    + + + None + + + + +

    style +

    + + Style | None + + +
    +

    The Rich Style under the mouse cursor.

    +
    + + + None + + + + + + + + + -
    @@ -9595,21 +10503,21 @@

    - button + button + - instance-attribute

    -
    button = button
    +
    button = button
     
    -
    - -

    Indexed of the pressed button.

    -
    +
    + +

    Indexed of the pressed button.

    +
    @@ -9618,21 +10526,21 @@

    - ctrl + ctrl + - instance-attribute

    -
    ctrl = ctrl
    +
    ctrl = ctrl
     
    -
    - -

    True if the ctrl key is pressed.

    -
    +
    + +

    True if the ctrl key is pressed.

    +
    @@ -9641,21 +10549,21 @@

    - delta + delta + - property

    -
    delta: Offset
    +
    delta
     
    -
    - -

    Mouse coordinate delta (change since last event).

    -
    +
    + +

    Mouse coordinate delta (change since last event).

    +
    @@ -9664,21 +10572,21 @@

    - delta_x + delta_x + - instance-attribute

    -
    delta_x = delta_x
    +
    delta_x = delta_x
     
    -
    - -

    Change in x since the last message.

    -
    +
    + +

    Change in x since the last message.

    +
    @@ -9687,21 +10595,21 @@

    - delta_y + delta_y + - instance-attribute

    -
    delta_y = delta_y
    +
    delta_y = delta_y
     
    -
    - -

    Change in y since the last message.

    -
    +
    + +

    Change in y since the last message.

    +
    @@ -9710,21 +10618,21 @@

    - meta + meta + - instance-attribute

    -
    meta = meta
    +
    meta = meta
     
    -
    - -

    True if the meta key is pressed.

    -
    +
    + +

    True if the meta key is pressed.

    +
    @@ -9733,39 +10641,44 @@

    - offset + offset + - property

    -
    offset: Offset
    +
    offset
     
    -
    - -

    The mouse coordinate as an offset.

    +
    + +

    The mouse coordinate as an offset.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Offset -

    Mouse coordinate.

    TypeDescription
    -
    + + + + + Offset + + +
    +

    Mouse coordinate.

    +
    + + + + +
    @@ -9774,21 +10687,21 @@

    - screen_offset + screen_offset + - property

    -
    screen_offset: Offset
    +
    screen_offset
     
    -
    - -

    Mouse coordinate relative to the screen.

    -
    +
    + +

    Mouse coordinate relative to the screen.

    +
    @@ -9797,21 +10710,21 @@

    - screen_x + screen_x + - instance-attribute

    -
    screen_x = x if screen_x is None else screen_x
    +
    screen_x = x if screen_x is None else screen_x
     
    -
    - -

    The absolute x coordinate.

    -
    +
    + +

    The absolute x coordinate.

    +
    @@ -9820,21 +10733,21 @@

    - screen_y + screen_y + - instance-attribute

    -
    screen_y = y if screen_y is None else screen_y
    +
    screen_y = y if screen_y is None else screen_y
     
    -
    - -

    The absolute y coordinate.

    -
    +
    + +

    The absolute y coordinate.

    +
    @@ -9843,21 +10756,21 @@

    - shift + shift + - instance-attribute

    -
    shift = shift
    +
    shift = shift
     
    -
    - -

    True if the shift key is pressed.

    -
    +
    + +

    True if the shift key is pressed.

    +
    @@ -9866,22 +10779,22 @@

    - style + style + - property writable

    -
    style: Style
    +
    style
     
    -
    - -

    The (Rich) Style under the cursor.

    -
    +
    + +

    The (Rich) Style under the cursor.

    +
    @@ -9890,21 +10803,21 @@

    - x + x + - instance-attribute

    -
    x = x
    +
    x = x
     
    -
    - -

    The relative x coordinate.

    -
    +
    + +

    The relative x coordinate.

    +
    @@ -9913,21 +10826,21 @@

    - y + y + - instance-attribute

    -
    y = y
    +
    y = y
     
    -
    - -

    The relative y coordinate.

    -
    +
    + +

    The relative y coordinate.

    +
    @@ -9936,125 +10849,147 @@

    -

    - get_content_offset + get_content_offset

    -
    get_content_offset(widget)
    +
    get_content_offset(widget)
     
    -
    - -

    Get offset within a widget's content area, or None if offset is not in content (i.e. padding or border).

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get offset within a widget's content area, or None if offset is not in content (i.e. padding or border).

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    widget - Widget -

    Widget receiving the event.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    widget +

    + Widget + +
    +

    Widget receiving the event.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Offset | None -

    An offset where the origin is at the top left of the content area.

    TypeDescription
    + + + + + Offset | None + + +
    +

    An offset where the origin is at the top left of the content area.

    +
    + + + + -
    +
    -

    - get_content_offset_capture + get_content_offset_capture

    -
    get_content_offset_capture(widget)
    +
    get_content_offset_capture(widget)
     
    -
    - -

    Get offset from a widget's content area.

    +
    + +

    Get offset from a widget's content area.

    This method works even if the offset is outside the widget content region.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    widget - Widget -

    Widget receiving the event.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    widget +

    + Widget + +
    +

    Widget receiving the event.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Offset -

    An offset where the origin is at the top left of the content area.

    TypeDescription
    + + + + + Offset + + +
    +

    An offset where the origin is at the top left of the content area.

    +
    + + + + -
    +
    @@ -10062,7 +10997,7 @@

    - MouseMove + MouseMove

    +
    MouseMove(
    +    x,
    +    y,
    +    delta_x,
    +    delta_y,
    +    button,
    +    shift,
    +    meta,
    +    ctrl,
    +    screen_x=None,
    +    screen_y=None,
    +    style=None,
    +)
    +
    +
    +

    + Bases: MouseEvent

    -
    -

    - Bases: MouseEvent

    - -

    Sent when the mouse cursor moves.

    + +

    Sent when the mouse cursor moves.

    • Bubbles
    • Verbose
    • @@ -10090,8 +11039,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -10099,51 +11068,63 @@

    - MouseRelease + MouseRelease

    -
    MouseRelease(mouse_position)
    +
    MouseRelease(mouse_position)
     
    -
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Mouse has been released.

    + + +

    Mouse has been released.

    • Bubbles
    • Verbose
    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    mouse_position - Offset -

    The position of the mouse when released.

    - required - NameTypeDescriptionDefault
    + + + + +

    mouse_position +

    + + Offset + + +
    +

    The position of the mouse when released.

    +
    + + + required + + + + + + + + + -
    @@ -10158,21 +11139,21 @@

    - mouse_position + mouse_position + - instance-attribute

    -
    mouse_position = mouse_position
    +
    mouse_position = mouse_position
     
    -
    - -

    The position of the mouse when released.

    -
    +
    + +

    The position of the mouse when released.

    +
    @@ -10182,7 +11163,7 @@

    -
    +
    @@ -10191,18 +11172,94 @@

    - MouseScrollDown + MouseScrollDown

    +
    MouseScrollDown(
    +    x,
    +    y,
    +    delta_x,
    +    delta_y,
    +    button,
    +    shift,
    +    meta,
    +    ctrl,
    +    screen_x=None,
    +    screen_y=None,
    +    style=None,
    +)
    +
    +
    +

    + Bases: MouseEvent

    -
    -

    - Bases: MouseEvent

    - -

    Sent when the mouse wheel is scrolled down.

    + +

    Sent when the mouse wheel is scrolled down.

    +
      +
    • Bubbles
    • +
    • Verbose
    • +
    + + + + + + + + + +
    + + + + + + + + + + + +
    + +
    + +
    + +
    + + + +

    + MouseScrollUp + + +

    +
    MouseScrollUp(
    +    x,
    +    y,
    +    delta_x,
    +    delta_y,
    +    button,
    +    shift,
    +    meta,
    +    ctrl,
    +    screen_x=None,
    +    screen_y=None,
    +    style=None,
    +)
    +
    + +
    +

    + Bases: MouseEvent

    + + + +

    Sent when the mouse wheel is scrolled up.

    • Bubbles
    • Verbose
    • @@ -10210,64 +11267,90 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    -

    - MouseScrollUp +

    + MouseUp -

    +

    +
    MouseUp(
    +    x,
    +    y,
    +    delta_x,
    +    delta_y,
    +    button,
    +    shift,
    +    meta,
    +    ctrl,
    +    screen_x=None,
    +    screen_y=None,
    +    style=None,
    +)
    +
    +
    +

    + Bases: MouseEvent

    -
    -

    - Bases: MouseEvent

    - -

    Sent when the mouse wheel is scrolled up.

    + +

    Sent when a mouse button is released.

    • Bubbles
    • -
    • Verbose
    • +
    • Verbose
    -
    -
    -
    -

    - MouseUp + +
    + + + -

    -
    -

    - Bases: MouseEvent

    - -

    Sent when a mouse button is released.

    -
      -
    • Bubbles
    • -
    • Verbose
    • -
    +
    +
    @@ -10275,19 +11358,20 @@

    - Paste + Paste

    -
    Paste(text)
    +
    Paste(text)
     
    -
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Event containing text that was pasted into the Textual application. + + +

    Event containing text that was pasted into the Textual application. This event will only appear when running in a terminal emulator that supports bracketed paste mode. Textual will enable bracketed pastes when an app starts, and disable it when the app shuts down.

    @@ -10296,33 +11380,44 @@

  • Verbose
  • -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    text - str -

    The text that has been pasted.

    - required - NameTypeDescriptionDefault
    + + + + +

    text +

    + + str + + +
    +

    The text that has been pasted.

    +
    + + + required + + + + + + + + + -
    @@ -10337,21 +11432,21 @@

    - text + text + - instance-attribute

    -
    text = text
    +
    text = text
     
    -
    - -

    The text that was pasted.

    -
    +
    + +

    The text that was pasted.

    +
    @@ -10361,7 +11456,7 @@

    -
    +
    @@ -10370,57 +11465,72 @@

    - Print + Print

    -
    Print(text, stderr=False)
    +
    Print(text, stderr=False)
     
    -
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Sent to a widget that is capturing print.

    + + +

    Sent to a widget that is capturing print.

    • Bubbles
    • Verbose
    -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    text - str -

    Text that was printed.

    - required -
    + - - - - + + + + - -
    stderr - bool -

    True if the print was to stderr, or False for stdout.

    - False - NameTypeDescriptionDefault
    + + + + +

    text +

    + + str + + +
    +

    Text that was printed.

    +
    + + + required + + + + +

    stderr +

    + + bool + + +
    +

    True if the print was to stderr, or False for stdout.

    +
    + + + False + + + + +
    Note @@ -10429,7 +11539,11 @@

    - + + + + +
    @@ -10444,21 +11558,21 @@

    - stderr + stderr + - instance-attribute

    -
    stderr = stderr
    +
    stderr = stderr
     
    -
    - -

    True if the print was to stderr, or False for stdout.

    -
    +
    + +

    True if the print was to stderr, or False for stdout.

    +
    @@ -10467,21 +11581,21 @@

    - text + text + - instance-attribute

    -
    text = text
    +
    text = text
     
    -
    - -

    The text that was printed.

    -
    +
    + +

    The text that was printed.

    +
    @@ -10491,7 +11605,7 @@

    -
    +
    @@ -10500,18 +11614,20 @@

    - Ready + Ready

    +
    Ready()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent to the App when the DOM is ready and the first frame has been displayed.

    + +

    Sent to the App when the DOM is ready and the first frame has been displayed.

    • Bubbles
    • Verbose
    • @@ -10519,8 +11635,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -10528,71 +11664,95 @@

    - Resize + Resize

    -
    Resize(size, virtual_size, container_size=None)
    +
     
    -  
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Sent when the app or widget has been resized.

    + + +

    Sent when the app or widget has been resized.

    • Bubbles
    • Verbose
    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    size - Size -

    The new size of the Widget.

    - required -
    virtual_size - Size -

    The virtual size (scrollable size) of the Widget.

    - required -
    + - - - - + + + + - -
    container_size - Size | None -

    The size of the Widget's container widget.

    - None - NameTypeDescriptionDefault
    + + + + +

    size +

    + + Size + + +
    +

    The new size of the Widget.

    +
    + + + required + + + + +

    virtual_size +

    + + Size + + +
    +

    The virtual size (scrollable size) of the Widget.

    +
    + + + required + + + + +

    container_size +

    + + Size | None + + +
    +

    The size of the Widget's container widget.

    +
    + + + None + + + + + + + + + -
    @@ -10607,23 +11767,23 @@

    - container_size + container_size + - instance-attribute

    -
    container_size = (
    -    size if container_size is None else container_size
    +
    container_size = (
    +    size if container_size is None else container_size
     )
     
    -
    - -

    The size of the Widget's container widget.

    -
    +
    + +

    The size of the Widget's container widget.

    +
    @@ -10632,21 +11792,21 @@

    - size + size + - instance-attribute

    -
    size = size
    +
    size = size
     
    -
    - -

    The new size of the Widget.

    -
    +
    + +

    The new size of the Widget.

    +
    @@ -10655,21 +11815,21 @@

    - virtual_size + virtual_size + - instance-attribute

    -
    virtual_size = virtual_size
    +
    virtual_size = virtual_size
     
    -
    - -

    The virtual size (scrollable size) of the Widget.

    -
    +
    + +

    The virtual size (scrollable size) of the Widget.

    +
    @@ -10679,7 +11839,7 @@

    -
    +
    @@ -10688,18 +11848,20 @@

    - ScreenResume + ScreenResume

    +
    ScreenResume()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent to screen that has been made active.

    + +

    Sent to screen that has been made active.

    • Bubbles
    • Verbose
    • @@ -10707,8 +11869,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -10716,18 +11898,20 @@

    - ScreenSuspend + ScreenSuspend

    +
    ScreenSuspend()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent to screen when it is no longer active.

    + +

    Sent to screen when it is no longer active.

    • Bubbles
    • Verbose
    • @@ -10735,8 +11919,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -10744,18 +11948,20 @@

    - Show + Show

    +
    Show()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent when a widget is first displayed.

    + +

    Sent when a widget is first displayed.

    • Bubbles
    • Verbose
    • @@ -10763,8 +11969,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -10772,19 +11998,20 @@

    - Timer + Timer

    -
    Timer(timer, time, count=0, callback=None)
    +
    Timer(timer, time, count=0, callback=None)
     
    -
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Sent in response to a timer.

    + + +

    Sent in response to a timer.

    • Bubbles
    • Verbose
    • @@ -10792,7 +12019,11 @@

      - + + + + +
      @@ -10808,7 +12039,7 @@

      -

    +
    @@ -10817,18 +12048,20 @@

    - Unmount + Unmount

    +
    Unmount()
    +
    +
    +

    + Bases: Event

    -
    -

    - Bases: Event

    - -

    Sent when a widget is unmounted and may no longer receive messages.

    + +

    Sent when a widget is unmounted and may no longer receive messages.

    • Bubbles
    • Verbose
    • @@ -10836,8 +12069,28 @@

      + + + + + + +
      + + + + + + + + + + +
      +

    +
    @@ -10845,7 +12098,7 @@

    -
    +
    diff --git a/api/filter/index.html b/api/filter/index.html index be86601f45..a84c2731e3 100644 --- a/api/filter/index.html +++ b/api/filter/index.html @@ -5250,7 +5250,7 @@
  • - textual.filter +  filter @@ -5259,7 +5259,7 @@
  • - NO_DIM +  NO_DIM @@ -5268,26 +5268,69 @@
  • - ANSIToTruecolor +  ANSIToTruecolor -
  • - DimFilter +  DimFilter -
  • - LineFilter +  LineFilter -
  • - + - dim_color() +  LineFilter -
  • - -
  • - + + +
  • + + + + + + +
  • + + +  Monochrome + + + + + +
  • + +
  • + + +  NoColor + + + + + +
  • + +
  • + + +  dim_color + + + + + +
  • + +
  • + + +  dim_style + + + + + +
  • + +
  • + + +  monochrome_style + + + + + +
  • + + + +
    @@ -6773,10 +7223,11 @@

    textual.filter

    + -
    - -

    Filter classes.

    +
    + +

    Filter classes.

    Note

    Filters are used internally, and not recommended for use by Textual app developers.

    @@ -6785,7 +7236,12 @@

    textual.filter

    Currently this is used internally to convert the application to monochrome, when the NO_COLOR env var is set.

    In the future, this system will be used to implement accessibility features.

    - + + + + + +
    @@ -6800,21 +7256,21 @@

    textual.filter

    - NO_DIM + NO_DIM + - module-attribute

    -
    NO_DIM = Style(dim=False)
    +
    NO_DIM = Style(dim=False)
     
    -
    - -

    A Style to set dim to False.

    -
    +
    + +

    A Style to set dim to False.

    +
    @@ -6824,48 +7280,60 @@

    - ANSIToTruecolor + ANSIToTruecolor

    -
    ANSIToTruecolor(terminal_theme, enabled=True)
    +
    ANSIToTruecolor(terminal_theme, enabled=True)
     
    -
    -

    - Bases: LineFilter

    +
    +

    + Bases: LineFilter

    - -

    Convert ANSI colors to their truecolor equivalents.

    - -

    Parameters:

    - - - - - - - - - - +

    Convert ANSI colors to their truecolor equivalents.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    terminal_theme - TerminalTheme -

    A rich terminal theme.

    - required - NameTypeDescriptionDefault
    + + + + +

    terminal_theme +

    + + TerminalTheme + + +
    +

    A rich terminal theme.

    +
    + + + required + + + + + + + + + + -
    @@ -6880,138 +7348,166 @@

    -

    - apply + apply

    -
    apply(segments, background)
    +
     
    -  
    - -

    Transform a list of segments.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Transform a list of segments.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    segments - list[Segment] -

    A list of segments.

    - required -
    + - - - - + + + + - -
    background - Color -

    The background color.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    segments +

    + list[Segment] + +
    +

    A list of segments.

    +
    +
    + required +
    +

    background +

    + Color + +
    +

    The background color.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[Segment] -

    A new list of segments.

    TypeDescription
    + + + + + list[Segment] + + +
    +

    A new list of segments.

    +
    + + + + -
    +
    -

    - truecolor_style + truecolor_style + - cached

    -
    truecolor_style(style)
    +
    truecolor_style(style)
     
    -
    - -

    Replace system colors with truecolor equivalent.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Replace system colors with truecolor equivalent.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    style - Style -

    Style to apply truecolor filter to.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    style +

    + Style + +
    +

    Style to apply truecolor filter to.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Style -

    New style.

    TypeDescription
    + + + + + Style + + +
    +

    New style.

    +
    + + + + -
    +
    @@ -7019,7 +7515,7 @@

    -
    +
    @@ -7028,48 +7524,60 @@

    - DimFilter + DimFilter

    -
    DimFilter(dim_factor=0.5)
    +
    DimFilter(dim_factor=0.5)
     
    -
    -

    - Bases: LineFilter

    +
    +

    + Bases: LineFilter

    - -

    Replace dim attributes with modified colors.

    - -

    Parameters:

    - - - - - - - - - - +

    Replace dim attributes with modified colors.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    dim_factor - float -

    The factor to dim by; 0 is 100% background (i.e. invisible), 1.0 is no change.

    - 0.5 - NameTypeDescriptionDefault
    + + + + +

    dim_factor +

    + + float + + +
    +

    The factor to dim by; 0 is 100% background (i.e. invisible), 1.0 is no change.

    +
    + + + 0.5 + + + + + + + + + + -
    @@ -7084,72 +7592,89 @@

    -

    - apply + apply

    -
    apply(segments, background)
    +
     
    -  
    - -

    Transform a list of segments.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Transform a list of segments.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    segments - list[Segment] -

    A list of segments.

    - required -
    + - - - - + + + + - -
    background - Color -

    The background color.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    segments +

    + list[Segment] + +
    +

    A list of segments.

    +
    +
    + required +
    +

    background +

    + Color + +
    +

    The background color.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[Segment] -

    A new list of segments.

    TypeDescription
    + + + + + list[Segment] + + +
    +

    A new list of segments.

    +
    + + + + -
    +
    @@ -7157,7 +7682,7 @@

    -
    +
    @@ -7166,23 +7691,28 @@

    - LineFilter + LineFilter

    -
    LineFilter(enabled=True)
    +
    LineFilter(enabled=True)
     
    -
    -

    - Bases: ABC

    +
    +

    + Bases: ABC

    + + + +

    Base class for a line filter.

    + + + + - -

    Base class for a line filter.

    -
    @@ -7197,76 +7727,93 @@

    -

    - apply + apply + - abstractmethod

    -
    apply(segments, background)
    +
     
    -  
    - -

    Transform a list of segments.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Transform a list of segments.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    segments - list[Segment] -

    A list of segments.

    - required -
    + - - - - + + + + - -
    background - Color -

    The background color.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    segments +

    + list[Segment] + +
    +

    A list of segments.

    +
    +
    + required +
    +

    background +

    + Color + +
    +

    The background color.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[Segment] -

    A new list of segments.

    TypeDescription
    + + + + + list[Segment] + + +
    +

    A new list of segments.

    +
    + + + + -
    +
    @@ -7274,7 +7821,7 @@

    -
    +
    @@ -7283,22 +7830,28 @@

    - Monochrome + Monochrome

    +
    Monochrome(enabled=True)
    +
    + +
    +

    + Bases: LineFilter

    + + + +

    Convert all colors to monochrome.

    + + -
    -

    - Bases: LineFilter

    - -

    Convert all colors to monochrome.

    -
    @@ -7313,72 +7866,89 @@

    -

    - apply + apply

    -
    apply(segments, background)
    +
     
    -  
    - -

    Transform a list of segments.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Transform a list of segments.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    segments - list[Segment] -

    A list of segments.

    - required -
    + - - - - + + + + - -
    background - Color -

    The background color.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    segments +

    + list[Segment] + +
    +

    A list of segments.

    +
    +
    + required +
    +

    background +

    + Color + +
    +

    The background color.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[Segment] -

    A new list of segments.

    TypeDescription
    + + + + + list[Segment] + + +
    +

    A new list of segments.

    +
    + + + + -
    +
    @@ -7386,7 +7956,7 @@

    -
    +
    @@ -7395,22 +7965,28 @@

    - NoColor + NoColor

    +
    NoColor(enabled=True)
    +
    + +
    +

    + Bases: LineFilter

    + + + +

    Remove all color information from segments.

    + + -
    -

    - Bases: LineFilter

    - -

    Remove all color information from segments.

    -
    @@ -7425,72 +8001,89 @@

    -

    - apply + apply

    -
    apply(segments, background)
    +
     
    -  
    - -

    Transform a list of segments.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Transform a list of segments.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    segments - list[Segment] -

    A list of segments.

    - required -
    + - - - - + + + + - -
    background - Color -

    The background color.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    segments +

    + list[Segment] + +
    +

    A list of segments.

    +
    +
    + required +
    +

    background +

    + Color + +
    +

    The background color.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[Segment] -

    A new list of segments.

    TypeDescription
    + + + + + list[Segment] + + +
    +

    A new list of segments.

    +
    + + + + -
    +
    @@ -7498,7 +8091,7 @@

    -
    +
    @@ -7506,228 +8099,279 @@

    -

    - dim_color + dim_color + - cached

    -
    dim_color(background, color, factor)
    +
    dim_color(background, color, factor)
     
    -
    - -

    Dim a color by blending towards the background

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Dim a color by blending towards the background

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    background - RichColor -

    background color.

    - required -
    color - RichColor -

    Foreground color.

    - required -
    + - - - - + + + + - -
    factor - float -

    Blend factor

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    background +

    + Color + +
    +

    background color.

    +
    +
    + required +
    +

    color +

    + Color + +
    +

    Foreground color.

    +
    +
    + required +
    +

    factor +

    + float + +
    +

    Blend factor

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - RichColor -

    New dimmer color.

    TypeDescription
    + + + + + Color + + +
    +

    New dimmer color.

    +
    + + + + -
    +
    -

    - dim_style + dim_style + - cached

    -
    dim_style(style, background, factor)
    +
    dim_style(style, background, factor)
     
    -
    - -

    Replace dim attribute with a dim color.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Replace dim attribute with a dim color.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    style - Style -

    Style to dim.

    - required -
    + - - - - + + + + - -
    factor - float -

    Blend factor.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    style +

    + Style + +
    +

    Style to dim.

    +
    +
    + required +
    +

    factor +

    + float + +
    +

    Blend factor.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Style -

    New dimmed style.

    TypeDescription
    + + + + + Style + + +
    +

    New dimmed style.

    +
    + + + + -
    +
    -

    - monochrome_style + monochrome_style + - cached

    -
    monochrome_style(style)
    +
    monochrome_style(style)
     
    -
    - -

    Convert colors in a style to monochrome.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Convert colors in a style to monochrome.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    style - Style -

    A Rich Style.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    style +

    + Style + +
    +

    A Rich Style.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Style -

    A new Rich style.

    TypeDescription
    + + + + + Style + + +
    +

    A new Rich style.

    +
    + + + + -
    +
    @@ -7735,7 +8379,7 @@

    -
    +
    diff --git a/api/fuzzy_matcher/index.html b/api/fuzzy_matcher/index.html index 7cdfdfb4d7..7339b96949 100644 --- a/api/fuzzy_matcher/index.html +++ b/api/fuzzy_matcher/index.html @@ -5271,7 +5271,7 @@
  • - textual.fuzzy +  fuzzy @@ -5280,17 +5280,44 @@
  • - Matcher +  Matcher -
  • @@ -6483,7 +6540,7 @@
  • - textual.fuzzy +  fuzzy @@ -6492,17 +6549,44 @@
  • - Matcher +  Matcher -
  • @@ -6581,13 +6695,19 @@

    textual.fuzzy

    + -
    - -

    Fuzzy matcher.

    +
    + +

    Fuzzy matcher.

    This class is used by the command palette to match search terms.

    - + + + + + +
    @@ -6603,66 +6723,90 @@

    textual.fuzzy

    - Matcher + Matcher

    -
    Matcher(query, *, match_style=None, case_sensitive=False)
    +
    Matcher(query, *, match_style=None, case_sensitive=False)
     
    -
    +
    - -

    A fuzzy matcher.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +

    A fuzzy matcher.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    query - str -

    A query as typed in by the user.

    - required -
    match_style - Style | None -

    The style to use to highlight matched portions of a string.

    - None -
    + - - - - + + + + - -
    case_sensitive - bool -

    Should matching be case sensitive?

    - False - NameTypeDescriptionDefault
    + + + + +

    query +

    + + str + + +
    +

    A query as typed in by the user.

    +
    + + + required + + + + +

    match_style +

    + + Style | None + + +
    +

    The style to use to highlight matched portions of a string.

    +
    + + + None + + + + +

    case_sensitive +

    + + bool + + +
    +

    Should matching be case sensitive?

    +
    + + + False + + + + + + + + + + -
    @@ -6677,21 +6821,21 @@

    - case_sensitive + case_sensitive + - property

    -
    case_sensitive: bool
    +
    case_sensitive
     
    -
    - -

    Is this matcher case sensitive?

    -
    +
    + +

    Is this matcher case sensitive?

    +
    @@ -6700,21 +6844,21 @@

    - match_style + match_style + - property

    -
    match_style: Style
    +
    match_style
     
    -
    - -

    The style that will be used to highlight hits in the matched text.

    -
    +
    + +

    The style that will be used to highlight hits in the matched text.

    +
    @@ -6723,21 +6867,21 @@

    - query + query + - property

    -
    query: str
    +
    query
     
    -
    - -

    The query string to look for.

    -
    +
    + +

    The query string to look for.

    +
    @@ -6746,21 +6890,21 @@

    - query_pattern + query_pattern + - property

    -
    query_pattern: str
    +
    query_pattern
     
    -
    - -

    The regular expression pattern built from the query.

    -
    +
    + +

    The regular expression pattern built from the query.

    +
    @@ -6769,124 +6913,146 @@

    -

    - highlight + highlight

    -
    highlight(candidate)
    +
    highlight(candidate)
     
    -
    - -

    Highlight the candidate with the fuzzy match.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Highlight the candidate with the fuzzy match.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    candidate - str -

    The candidate string to match against the query.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    candidate +

    + str + +
    +

    The candidate string to match against the query.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Text -

    A [rich.text.Text][Text] object with highlighted matches.

    TypeDescription
    + + + + + Text + + +
    +

    A [rich.text.Text][Text] object with highlighted matches.

    +
    + + + + -
    +
    -

    - match + match

    -
    match(candidate)
    +
    match(candidate)
     
    -
    - -

    Match the candidate against the query.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Match the candidate against the query.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    candidate - str -

    Candidate string to match against the query.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    candidate +

    + str + +
    +

    Candidate string to match against the query.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - float -

    Strength of the match from 0 to 1.

    TypeDescription
    + + + + + float + + +
    +

    Strength of the match from 0 to 1.

    +
    + + + + -
    +
    @@ -6894,7 +7060,7 @@

    -
    +
    @@ -6903,7 +7069,7 @@

    -
    +
    diff --git a/api/geometry/index.html b/api/geometry/index.html index 60f45c57ca..6a7b05a0c4 100644 --- a/api/geometry/index.html +++ b/api/geometry/index.html @@ -5292,7 +5292,7 @@
  • - textual.geometry +  geometry @@ -5301,7 +5301,7 @@
  • - NULL_OFFSET +  NULL_OFFSET @@ -5310,7 +5310,7 @@
  • - NULL_REGION +  NULL_REGION @@ -5319,7 +5319,7 @@
  • - NULL_SIZE +  NULL_SIZE @@ -5328,7 +5328,7 @@
  • - NULL_SPACING +  NULL_SPACING @@ -5337,7 +5337,7 @@
  • - SpacingDimensions +  SpacingDimensions @@ -5346,17 +5346,17 @@
  • - Offset +  Offset -
  • - Region +  Region -
  • - - - - - - + + + +
  • + + +  split_vertical + + + - - textual.lazy - +
  • + +
  • + + +  translate + + - - -
  • + + + +
  • + + +  translate_inside + + + - - -
  • + + +
  • + + +  union + + - - - - - + +
  • + + + + + +
  • + + +  Size + + -
  • - + +
  • + +
  • + + +  Spacing + + -
  • - + + +
  • + +
  • + + +  clamp + + + + + +
  • + + + + + @@ -6331,11 +6880,11 @@
  • - + - textual.renderables + textual.lazy @@ -6352,11 +6901,11 @@
  • - + - textual.screen + textual @@ -6373,11 +6922,11 @@
  • - + - textual.scrollbar + textual.logging @@ -6394,11 +6943,11 @@
  • - + - textual.scroll_view + textual.map_geometry @@ -6415,11 +6964,11 @@
  • - + - textual.signal + textual.message_pump @@ -6436,11 +6985,11 @@
  • - + - textual.strip + textual.message @@ -6457,11 +7006,11 @@
  • - + - textual.suggester + textual.on @@ -6478,11 +7027,11 @@
  • - + - textual.system_commands + textual.pilot @@ -6499,11 +7048,11 @@
  • - + - textual.timer + textual.css.query @@ -6520,11 +7069,11 @@
  • - + - textual.types + textual.reactive @@ -6541,11 +7090,11 @@
  • - + - textual.validation + textual.renderables @@ -6562,11 +7111,11 @@
  • - + - textual.walk + textual.screen @@ -6583,11 +7132,11 @@
  • - + - textual.widget + textual.scrollbar @@ -6604,11 +7153,11 @@
  • - + - textual.work + textual.scroll_view @@ -6625,11 +7174,11 @@
  • - + - textual.worker + textual.signal @@ -6646,11 +7195,11 @@
  • - + - textual.worker_manager + textual.strip @@ -6660,75 +7209,25 @@ - - - -
  • - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - -
  • - - - - +
  • + - - - - - - -
  • - - - - - + +
  • - + - FAQ + textual.widget @@ -6862,19 +7354,62 @@
  • - - - + + + +
  • - + - Roadmap + textual.work + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.worker + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.worker_manager @@ -6882,6 +7417,14 @@
  • + + + + + + + + @@ -6894,6 +7437,12 @@ + + + + + + @@ -6910,32 +7459,32 @@ - + -
    +
    +
    + + + +
    +
    +
    + + + - - - - -
    -
    -
    - - - -
    -
    -
    - - - + + + +
  • + - overlaps() +  Size -
  • + +
  • - Spacing +  Spacing -
  • - clamp() +  clamp + + + + +
  • @@ -8057,12 +9575,18 @@

    textual.geometry

    + -
    - -

    Functions and classes to manage terminal geometry (anything involving coordinates or dimensions).

    +
    + +

    Functions and classes to manage terminal geometry (anything involving coordinates or dimensions).

    + + + + + + -
    @@ -8077,21 +9601,21 @@

    textual.geometry

    - NULL_OFFSET + NULL_OFFSET + - module-attribute

    -
    NULL_OFFSET: Final = Offset(0, 0)
    +
    NULL_OFFSET = Offset(0, 0)
     
    -
    - -

    An offset constant for (0, 0).

    -
    +
    + +

    An offset constant for (0, 0).

    +
    @@ -8100,21 +9624,21 @@

    - NULL_REGION + NULL_REGION + - module-attribute

    -
    NULL_REGION: Final = Region(0, 0, 0, 0)
    +
    NULL_REGION = Region(0, 0, 0, 0)
     
    -
    - -

    A Region constant for a null region (at the origin, with both width and height set to zero).

    -
    +
    + +

    A Region constant for a null region (at the origin, with both width and height set to zero).

    +
    @@ -8123,21 +9647,21 @@

    - NULL_SIZE + NULL_SIZE + - module-attribute

    -
    NULL_SIZE: Final = Size(0, 0)
    +
    NULL_SIZE = Size(0, 0)
     
    -
    - -

    A Size constant for a null size (with zero area).

    -
    +
    + +

    A Size constant for a null size (with zero area).

    +
    @@ -8146,21 +9670,21 @@

    - NULL_SPACING + NULL_SPACING + - module-attribute

    -
    NULL_SPACING: Final = Spacing(0, 0, 0, 0)
    +
    NULL_SPACING = Spacing(0, 0, 0, 0)
     
    -
    - -

    A Spacing constant for no space.

    -
    +
    + +

    A Spacing constant for no space.

    +
    @@ -8169,26 +9693,26 @@

    - SpacingDimensions + SpacingDimensions + - module-attribute

    -
    SpacingDimensions: TypeAlias = Union[
    -    int,
    -    Tuple[int],
    -    Tuple[int, int],
    -    Tuple[int, int, int, int],
    +
    SpacingDimensions = Union[
    +    int,
    +    Tuple[int],
    +    Tuple[int, int],
    +    Tuple[int, int, int, int],
     ]
     
    -
    - -

    The valid ways in which you can specify spacing.

    -
    +
    + +

    The valid ways in which you can specify spacing.

    +
    @@ -8198,22 +9722,24 @@

    - Offset + Offset

    -
    -

    - Bases: NamedTuple

    +
    +

    + Bases: NamedTuple

    - -

    A cell offset defined by x and y coordinates.

    + + +

    A cell offset defined by x and y coordinates.

    Offsets are typically relative to the top left of the terminal or other container.

    Textual prefers the names x and y, but you could consider x to be the column and y to be the row.

    Offsets support addition, subtraction, multiplication, and negation.

    +
    Example
    >>> from textual.geometry import Offset
    @@ -8229,7 +9755,11 @@ 

    - + + + + +
    @@ -8244,21 +9774,21 @@

    - clamped + clamped + - property

    -
    clamped: Offset
    +
    clamped
     
    -
    - -

    This offset with x and y restricted to values above zero.

    -
    +
    + +

    This offset with x and y restricted to values above zero.

    +
    @@ -8267,21 +9797,21 @@

    - is_origin + is_origin + - property

    -
    is_origin: bool
    +
    is_origin
     
    -
    - -

    Is the offset at (0, 0)?

    -
    +
    + +

    Is the offset at (0, 0)?

    +
    @@ -8290,22 +9820,22 @@

    - x + x + - - instance-attribute class-attribute + instance-attribute

    -
    x: int = 0
    +
    x = 0
     
    -
    - -

    Offset in the x-axis (horizontal)

    -
    +
    + +

    Offset in the x-axis (horizontal)

    +
    @@ -8314,22 +9844,22 @@

    - y + y + - - instance-attribute class-attribute + instance-attribute

    -
    y: int = 0
    +
    y = 0
     
    -
    - -

    Offset in the y-axis (vertical)

    -
    +
    + +

    Offset in the y-axis (vertical)

    +
    @@ -8338,206 +9868,251 @@

    -

    - blend + blend

    -
    blend(destination, factor)
    +
     
    -  
    - -

    Calculate a new offset on a line between this offset and a destination offset.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Calculate a new offset on a line between this offset and a destination offset.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    destination - Offset -

    Point where factor would be 1.0.

    - required -
    + - - - - + + + + - -
    factor - float -

    A value between 0 and 1.0.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    destination +

    + Offset + +
    +

    Point where factor would be 1.0.

    +
    +
    + required +
    +

    factor +

    + float + +
    +

    A value between 0 and 1.0.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Offset -

    A new point on a line between self and destination.

    TypeDescription
    + + + + + Offset + + +
    +

    A new point on a line between self and destination.

    +
    + + + + -
    +
    -

    - clamp + clamp

    -
    clamp(width, height)
    +
    clamp(width, height)
     
    -
    - -

    Clamp the offset to fit within a rectangle of width x height.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Clamp the offset to fit within a rectangle of width x height.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    width - int -

    Width to clamp.

    - required -
    + - - - - + + + + - -
    height - int -

    Height to clamp.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    width +

    + int + +
    +

    Width to clamp.

    +
    +
    + required +
    +

    height +

    + int + +
    +

    Height to clamp.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Offset -

    A new offset.

    TypeDescription
    + + + + + Offset + + +
    +

    A new offset.

    +
    + + + + -
    +
    -

    - get_distance_to + get_distance_to

    -
    get_distance_to(other)
    +
    get_distance_to(other)
     
    -
    - -

    Get the distance to another offset.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the distance to another offset.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    other - Offset -

    An offset.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    other +

    + Offset + +
    +

    An offset.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - float -

    Distance to other offset.

    TypeDescription
    + + + + + float + + +
    +

    Distance to other offset.

    +
    + + + + -
    +
    @@ -8545,7 +10120,7 @@

    -
    +
    @@ -8554,18 +10129,19 @@

    - Region + Region

    -
    -

    - Bases: NamedTuple

    +
    +

    + Bases: NamedTuple

    - -

    Defines a rectangular region.

    + + +

    Defines a rectangular region.

    A Region consists of a coordinate (x and y) and dimensions (width and height).

      (x, y)
         ┌────────────────────┐ ▲
    @@ -8578,6 +10154,7 @@ 

    ◀─────── width ──────▶

    +
    Example
    >>> from textual.geometry import Region
    @@ -8598,7 +10175,11 @@ 

    - + + + + +
    @@ -8613,21 +10194,21 @@

    - area + area + - property

    -
    area: int
    +
    area
     
    -
    - -

    The area under the region.

    -
    +
    + +

    The area under the region.

    +
    @@ -8636,21 +10217,21 @@

    - bottom + bottom + - property

    -
    bottom: int
    +
    bottom
     
    -
    - -

    Maximum Y value (non inclusive).

    -
    +
    + +

    Maximum Y value (non inclusive).

    +
    @@ -8659,39 +10240,44 @@

    - bottom_left + bottom_left + - property

    -
    bottom_left: Offset
    +
    bottom_left
     
    -
    - -

    Bottom left offset of the region.

    +
    + +

    Bottom left offset of the region.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Offset -

    An offset.

    TypeDescription
    -
    + + + + + Offset + + +
    +

    An offset.

    +
    + + + + +
    @@ -8700,39 +10286,44 @@

    - bottom_right + bottom_right + - property

    -
    bottom_right: Offset
    +
    bottom_right
     
    -
    - -

    Bottom right offset of the region.

    +
    + +

    Bottom right offset of the region.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Offset -

    An offset.

    TypeDescription
    -
    + + + + + Offset + + +
    +

    An offset.

    +
    + + + + +
    @@ -8741,40 +10332,45 @@

    - center + center + - property

    -
    center: tuple[float, float]
    +
    center
     
    -
    - -

    The center of the region.

    +
    + +

    The center of the region.

    Note, that this does not return an Offset, because the center may not be an integer coordinate.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - tuple[float, float] -

    Tuple of floats.

    TypeDescription
    -
    + + + + + tuple[float, float] + + +
    +

    Tuple of floats.

    +
    + + + + +
    @@ -8783,21 +10379,21 @@

    - column_range + column_range + - property

    -
    column_range: range
    +
    column_range
     
    -
    - -

    A range object for X coordinates.

    -
    +
    + +

    A range object for X coordinates.

    +
    @@ -8806,22 +10402,22 @@

    - column_span + column_span + - property

    -
    column_span: tuple[int, int]
    +
    column_span
     
    -
    - -

    A pair of integers for the start and end columns (x coordinates) in this region.

    +
    + +

    A pair of integers for the start and end columns (x coordinates) in this region.

    The end value is exclusive.

    -
    +
    @@ -8830,21 +10426,21 @@

    - corners + corners + - property

    -
    corners: tuple[int, int, int, int]
    +
    corners
     
    -
    - -

    The top left and bottom right coordinates as a tuple of four integers.

    -
    +
    + +

    The top left and bottom right coordinates as a tuple of four integers.

    +
    @@ -8853,22 +10449,22 @@

    - height + height + - - instance-attribute class-attribute + instance-attribute

    -
    height: int = 0
    +
    height = 0
     
    -
    - -

    The height of the region.

    -
    +
    + +

    The height of the region.

    +
    @@ -8877,21 +10473,21 @@

    - line_range + line_range + - property

    -
    line_range: range
    +
    line_range
     
    -
    - -

    A range object for Y coordinates.

    -
    +
    + +

    A range object for Y coordinates.

    +
    @@ -8900,22 +10496,22 @@

    - line_span + line_span + - property

    -
    line_span: tuple[int, int]
    +
    line_span
     
    -
    - -

    A pair of integers for the start and end lines (y coordinates) in this region.

    +
    + +

    A pair of integers for the start and end lines (y coordinates) in this region.

    The end value is exclusive.

    -
    +
    @@ -8924,39 +10520,44 @@

    - offset + offset + - property

    -
    offset: Offset
    +
    offset
     
    -
    - -

    The top left corner of the region.

    +
    + +

    The top left corner of the region.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Offset -

    An offset.

    TypeDescription
    -
    + + + + + Offset + + +
    +

    An offset.

    +
    + + + + +
    @@ -8965,39 +10566,44 @@

    - reset_offset + reset_offset + - property

    -
    reset_offset: Region
    +
    reset_offset
     
    -
    - -

    An region of the same size at (0, 0).

    +
    + +

    An region of the same size at (0, 0).

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Region -

    A region at the origin.

    TypeDescription
    -
    + + + + + Region + + +
    +

    A region at the origin.

    +
    + + + + +
    @@ -9006,21 +10612,21 @@

    - right + right + - property

    -
    right: int
    +
    right
     
    -
    - -

    Maximum X value (non inclusive).

    -
    +
    + +

    Maximum X value (non inclusive).

    +
    @@ -9029,21 +10635,21 @@

    - size + size + - property

    -
    size: Size
    +
    size
     
    -
    - -

    Get the size of the region.

    -
    +
    + +

    Get the size of the region.

    +
    @@ -9052,39 +10658,44 @@

    - top_right + top_right + - property

    -
    top_right: Offset
    +
    top_right
     
    -
    - -

    Top right offset of the region.

    +
    + +

    Top right offset of the region.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Offset -

    An offset.

    TypeDescription
    -
    + + + + + Offset + + +
    +

    An offset.

    +
    + + + + +
    @@ -9093,22 +10704,22 @@

    - width + width + - - instance-attribute class-attribute + instance-attribute

    -
    width: int = 0
    +
    width = 0
     
    -
    - -

    The width of the region.

    -
    +
    + +

    The width of the region.

    +
    @@ -9117,22 +10728,22 @@

    - x + x + - - instance-attribute class-attribute + instance-attribute

    -
    x: int = 0
    +
    x = 0
     
    -
    - -

    Offset in the x-axis (horizontal).

    -
    +
    + +

    Offset in the x-axis (horizontal).

    +
    @@ -9141,22 +10752,22 @@

    - y + y + - - instance-attribute class-attribute + instance-attribute

    -
    y: int = 0
    +
    y = 0
     
    -
    - -

    Offset in the y-axis (vertical).

    -
    +
    + +

    Offset in the y-axis (vertical).

    +
    @@ -9165,1022 +10776,1241 @@

    -

    - at_offset + at_offset

    -
    at_offset(offset)
    +
    at_offset(offset)
     
    -
    - -

    Get a new Region with the same size at a given offset.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get a new Region with the same size at a given offset.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    offset - tuple[int, int] -

    An offset.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    offset +

    + tuple[int, int] + +
    +

    An offset.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    New Region with adjusted offset.

    TypeDescription
    + + + + + Region + + +
    +

    New Region with adjusted offset.

    +
    + + + + -
    +
    -

    - clip + clip + + +

    +
    clip(width, height)
    +
    + +
    +

    Clip this region to fit within width, height.

    -

    -
    clip(width, height)
    -
    -
    - -

    Clip this region to fit within width, height.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +

    Parameters:

    +
    NameTypeDescriptionDefault
    width - int -

    Width of bounds.

    - required -
    + - - - - + + + + - -
    height - int -

    Height of bounds.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    width +

    + int + +
    +

    Width of bounds.

    +
    +
    + required +
    +

    height +

    + int + +
    +

    Height of bounds.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    Clipped region.

    TypeDescription
    + + + + + Region + + +
    +

    Clipped region.

    +
    + + + + -
    +
    -

    - constrain + constrain

    -
    constrain(constrain_x, constrain_y, margin, container)
    +
     
    -  
    - -

    Constrain a region to fit within a container, using different methods per axis.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Constrain a region to fit within a container, using different methods per axis.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    constrain_x - Literal['none', 'inside', 'inflect'] -

    Constrain method for the X-axis.

    - required -
    constrain_y - Literal['none', 'inside', 'inflect'] -

    Constrain method for the Y-axis.

    - required -
    margin - Spacing -

    Margin to maintain around region.

    - required -
    + - - - - + + + + - -
    container - Region -

    Container to constrain to.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    constrain_x +

    + Literal['none', 'inside', 'inflect'] + +
    +

    Constrain method for the X-axis.

    +
    +
    + required +
    +

    constrain_y +

    + Literal['none', 'inside', 'inflect'] + +
    +

    Constrain method for the Y-axis.

    +
    +
    + required +
    +

    margin +

    + Spacing + +
    +

    Margin to maintain around region.

    +
    +
    + required +
    +

    container +

    + Region + +
    +

    Container to constrain to.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    New widget, that fits inside the container (if possible).

    TypeDescription
    + + + + + Region + + +
    +

    New widget, that fits inside the container (if possible).

    +
    + + + + -
    +
    -

    - contains + contains

    -
    contains(x, y)
    +
    contains(x, y)
     
    -
    - -

    Check if a point is in the region.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Check if a point is in the region.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    x - int -

    X coordinate.

    - required -
    + - - - - + + + + - -
    y - int -

    Y coordinate.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    x +

    + int + +
    +

    X coordinate.

    +
    +
    + required +
    +

    y +

    + int + +
    +

    Y coordinate.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the point is within the region.

    TypeDescription
    + + + + + bool + + +
    +

    True if the point is within the region.

    +
    + + + + -
    +
    -

    - contains_point + contains_point

    -
    contains_point(point)
    +
    contains_point(point)
     
    -
    - -

    Check if a point is in the region.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Check if a point is in the region.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    point - tuple[int, int] -

    A tuple of x and y coordinates.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    point +

    + tuple[int, int] + +
    +

    A tuple of x and y coordinates.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the point is within the region.

    TypeDescription
    + + + + + bool + + +
    +

    True if the point is within the region.

    +
    + + + + -
    +
    -

    - contains_region + contains_region + - cached

    -
    contains_region(other)
    +
    contains_region(other)
     
    -
    - -

    Check if a region is entirely contained within this region.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Check if a region is entirely contained within this region.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    other - Region -

    A region.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    other +

    + Region + +
    +

    A region.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the other region fits perfectly within this region.

    TypeDescription
    + + + + + bool + + +
    +

    True if the other region fits perfectly within this region.

    +
    + + + + -
    +
    -

    - crop_size + crop_size

    -
    crop_size(size)
    +
    crop_size(size)
     
    -
    - -

    Get a region with the same offset, with a size no larger than size.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get a region with the same offset, with a size no larger than size.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    size - tuple[int, int] -

    Maximum width and height (WIDTH, HEIGHT).

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    size +

    + tuple[int, int] + +
    +

    Maximum width and height (WIDTH, HEIGHT).

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    New region that could fit within size.

    TypeDescription
    + + + + + Region + + +
    +

    New region that could fit within size.

    +
    + + + + -
    +
    -

    - expand + expand

    -
    expand(size)
    +
    expand(size)
     
    -
    - -

    Increase the size of the region by adding a border.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Increase the size of the region by adding a border.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    size - tuple[int, int] -

    Additional width and height.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    size +

    + tuple[int, int] + +
    +

    Additional width and height.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    A new region.

    TypeDescription
    + + + + + Region + + +
    +

    A new region.

    +
    + + + + -
    +
    -

    - from_corners + from_corners + - classmethod

    -
    from_corners(x1, y1, x2, y2)
    +
    from_corners(x1, y1, x2, y2)
     
    -
    - -

    Construct a Region form the top left and bottom right corners.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Construct a Region form the top left and bottom right corners.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    x1 - int -

    Top left x.

    - required -
    y1 - int -

    Top left y.

    - required -
    x2 - int -

    Bottom right x.

    - required -
    + - - - - + + + + - -
    y2 - int -

    Bottom right y.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    x1 +

    + int + +
    +

    Top left x.

    +
    +
    + required +
    +

    y1 +

    + int + +
    +

    Top left y.

    +
    +
    + required +
    +

    x2 +

    + int + +
    +

    Bottom right x.

    +
    +
    + required +
    +

    y2 +

    + int + +
    +

    Bottom right y.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    A new region.

    TypeDescription
    + + + + + Region + + +
    +

    A new region.

    +
    + + + + -
    +
    -

    - from_offset + from_offset + - classmethod

    -
    from_offset(offset, size)
    +
    from_offset(offset, size)
     
    -
    - -

    Create a region from offset and size.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Create a region from offset and size.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    offset - tuple[int, int] -

    Offset (top left point).

    - required -
    + - - - - + + + + - -
    size - tuple[int, int] -

    Dimensions of region.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    offset +

    + tuple[int, int] + +
    +

    Offset (top left point).

    +
    +
    + required +
    +

    size +

    + tuple[int, int] + +
    +

    Dimensions of region.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    A region instance.

    TypeDescription
    + + + + + Region + + +
    +

    A region instance.

    +
    + + + + -
    +
    -

    - from_union + from_union + - classmethod

    -
    from_union(regions)
    +
    from_union(regions)
     
    -
    - -

    Create a Region from the union of other regions.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Create a Region from the union of other regions.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    regions - Collection[Region] -

    One or more regions.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    regions +

    + Collection[Region] + +
    +

    One or more regions.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    A Region that encloses all other regions.

    TypeDescription
    + + + + + Region + + +
    +

    A Region that encloses all other regions.

    +
    + + + + -
    +
    -

    - get_scroll_to_visible + get_scroll_to_visible + - classmethod

    -
    get_scroll_to_visible(window_region, region, *, top=False)
    +
    get_scroll_to_visible(window_region, region, *, top=False)
     
    -
    - -

    Calculate the smallest offset required to translate a window so that it contains +

    + +

    Calculate the smallest offset required to translate a window so that it contains another region.

    This method is used to calculate the required offset to scroll something in to view.

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    window_region - Region -

    The window region.

    - required -
    region - Region -

    The region to move inside the window.

    - required -
    + - - - - + + + + - -
    top - bool -

    Get offset to top of window.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    window_region +

    + Region + +
    +

    The window region.

    +
    +
    + required +
    +

    region +

    + Region + +
    +

    The region to move inside the window.

    +
    +
    + required +
    +

    top +

    + bool + +
    +

    Get offset to top of window.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Offset -

    An offset required to add to region to move it inside window_region.

    TypeDescription
    + + + + + Offset + + +
    +

    An offset required to add to region to move it inside window_region.

    +
    + + + + -
    +
    -

    - get_spacing_between + get_spacing_between

    -
    get_spacing_between(region)
    +
    get_spacing_between(region)
     
    -
    - -

    Get spacing between two regions.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get spacing between two regions.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    region - Region -

    Another region.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    region +

    + Region + +
    +

    Another region.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Spacing -

    Spacing that if subtracted from self produces region.

    TypeDescription
    + + + + + Spacing + + +
    +

    Spacing that if subtracted from self produces region.

    +
    + + + + -
    +
    -

    - grow + grow + - cached

    -
    grow(margin)
    +
    grow(margin)
     
    -
    - -

    Grow a region by adding spacing.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Grow a region by adding spacing.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    margin - tuple[int, int, int, int] -

    Grow space by (<top>, <right>, <bottom>, <left>).

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    margin +

    + tuple[int, int, int, int] + +
    +

    Grow space by (<top>, <right>, <bottom>, <left>).

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    New region.

    TypeDescription
    + + + + + Region + + +
    +

    New region.

    +
    + + + + -
    +
    -

    - inflect + inflect

    -
    inflect(x_axis=+1, y_axis=+1, margin=None)
    +
    inflect(x_axis=+1, y_axis=+1, margin=None)
     
    -
    - -

    Inflect a region around one or both axis.

    +
    + +

    Inflect a region around one or both axis.

    The x_axis and y_axis parameters define which direction to move the region. A positive value will move the region right or down, a negative value will move the region left or up. A value of 0 will leave that axis unmodified.

    @@ -10200,289 +12030,345 @@

    └──────────┘

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    x_axis - int -

    +1 to inflect in the positive direction, -1 to inflect in the negative direction.

    - +1 -
    y_axis - int -

    +1 to inflect in the positive direction, -1 to inflect in the negative direction.

    - +1 -
    + - - - - + + + + - -
    margin - Spacing | None -

    Additional margin.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    x_axis +

    + int + +
    +

    +1 to inflect in the positive direction, -1 to inflect in the negative direction.

    +
    +
    + +1 +
    +

    y_axis +

    + int + +
    +

    +1 to inflect in the positive direction, -1 to inflect in the negative direction.

    +
    +
    + +1 +
    +

    margin +

    + Spacing | None + +
    +

    Additional margin.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    A new region.

    TypeDescription
    + + + + + Region + + +
    +

    A new region.

    +
    + + + + -
    +
    -

    - intersection + intersection + - cached

    -
    intersection(region)
    +
    intersection(region)
     
    -
    - -

    Get the overlapping portion of the two regions.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the overlapping portion of the two regions.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    region - Region -

    A region that overlaps this region.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    region +

    + Region + +
    +

    A region that overlaps this region.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    A new region that covers when the two regions overlap.

    TypeDescription
    + + + + + Region + + +
    +

    A new region that covers when the two regions overlap.

    +
    + + + + -
    +
    -

    - overlaps + overlaps + - cached

    -
    overlaps(other)
    +
    overlaps(other)
     
    -
    - -

    Check if another region overlaps this region.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Check if another region overlaps this region.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    other - Region -

    A Region.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    other +

    + Region + +
    +

    A Region.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if other region shares any cells with this region.

    TypeDescription
    + + + + + bool + + +
    +

    True if other region shares any cells with this region.

    +
    + + + + -
    +
    -

    - shrink + shrink + - cached

    -
    shrink(margin)
    +
    shrink(margin)
     
    -
    - -

    Shrink a region by subtracting spacing.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Shrink a region by subtracting spacing.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    margin - tuple[int, int, int, int] -

    Shrink space by (<top>, <right>, <bottom>, <left>).

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    margin +

    + tuple[int, int, int, int] + +
    +

    Shrink space by (<top>, <right>, <bottom>, <left>).

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    The new, smaller region.

    TypeDescription
    + + + + + Region + + +
    +

    The new, smaller region.

    +
    + + + + -
    +
    -

    - split + split + - cached

    -
    split(cut_x, cut_y)
    +
    split(cut_x, cut_y)
     
    -
    - -

    Split a region in to 4 from given x and y offsets (cuts).

    +
    + +

    Split a region in to 4 from given x and y offsets (cuts).

               cut_x ↓
             ┌────────┐ ┌───┐
             │        │ │   │
    @@ -10494,83 +12380,100 @@ 

    └────────┘ └───┘

    -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    cut_x - int -

    Offset from self.x where the cut should be made. If negative, the cut -is taken from the right edge.

    - required -
    + - - - - + + + + - -
    cut_y - int -

    Offset from self.y where the cut should be made. If negative, the cut -is taken from the lower edge.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    cut_x +

    + int + +
    +

    Offset from self.x where the cut should be made. If negative, the cut +is taken from the right edge.

    +
    +
    + required +
    +

    cut_y +

    + int + +
    +

    Offset from self.y where the cut should be made. If negative, the cut +is taken from the lower edge.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - tuple[Region, Region, Region, Region] -

    Four new regions which add up to the original (self).

    TypeDescription
    + + + + + tuple[Region, Region, Region, Region] + + +
    +

    Four new regions which add up to the original (self).

    +
    + + + + -
    +
    -

    - split_horizontal + split_horizontal + - cached

    -
    split_horizontal(cut)
    +
    split_horizontal(cut)
     
    -
    - -

    Split a region in to two, from a given y offset.

    +
    + +

    Split a region in to two, from a given y offset.

                ┌─────────┐
                 │    0    │
                 │         │
    @@ -10580,72 +12483,83 @@ 

    └─────────┘

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    cut - int -

    An offset from self.y where the cut should be made. May be negative, -for the offset to start from the lower edge.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    cut +

    + int + +
    +

    An offset from self.y where the cut should be made. May be negative, +for the offset to start from the lower edge.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - tuple[Region, Region] -

    Two regions, which add up to the original (self).

    TypeDescription
    + + + + + tuple[Region, Region] + + +
    +

    Two regions, which add up to the original (self).

    +
    + + + + -
    +
    -

    - split_vertical + split_vertical + - cached

    -
    split_vertical(cut)
    +
    split_vertical(cut)
     
    -
    - -

    Split a region in to two, from a given x offset.

    +
    + +

    Split a region in to two, from a given x offset.

             cut ↓
         ┌────────┐┌───┐
         │    0   ││ 1 │
    @@ -10653,134 +12567,156 @@ 

    └────────┘└───┘

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    cut - int -

    An offset from self.x where the cut should be made. If cut is negative, -it is taken from the right edge.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    cut +

    + int + +
    +

    An offset from self.x where the cut should be made. If cut is negative, +it is taken from the right edge.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - tuple[Region, Region] -

    Two regions, which add up to the original (self).

    TypeDescription
    + + + + + tuple[Region, Region] + + +
    +

    Two regions, which add up to the original (self).

    +
    + + + + -
    +
    -

    - translate + translate + - cached

    -
    translate(offset)
    +
    translate(offset)
     
    -
    - -

    Move the offset of the Region.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Move the offset of the Region.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    offset - tuple[int, int] -

    Offset to add to region.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    offset +

    + tuple[int, int] + +
    +

    Offset to add to region.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    A new region shifted by (x, y).

    TypeDescription
    + + + + + Region + + +
    +

    A new region shifted by (x, y).

    +
    + + + + -
    +
    -

    - translate_inside + translate_inside

    -
    translate_inside(container, x_axis=True, y_axis=True)
    +
    translate_inside(container, x_axis=True, y_axis=True)
     
    -
    - -

    Translate this region, so it fits within a container.

    +
    + +

    Translate this region, so it fits within a container.

    This will ensure that there is as little overlap as possible. The top left of the returned region is guaranteed to be within the container.

    ┌──────────────────┐         ┌──────────────────┐
    @@ -10794,135 +12730,170 @@ 

    └─────────────┘

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    container - Region -

    A container region.

    - required -
    x_axis - bool -

    Allow translation of X axis.

    - True -
    + - - - - + + + + - -
    y_axis - bool -

    Allow translation of Y axis.

    - True - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    container +

    + Region + +
    +

    A container region.

    +
    +
    + required +
    +

    x_axis +

    + bool + +
    +

    Allow translation of X axis.

    +
    +
    + True +
    +

    y_axis +

    + bool + +
    +

    Allow translation of Y axis.

    +
    +
    + True +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    A new region with same dimensions that fits with inside container.

    TypeDescription
    + + + + + Region + + +
    +

    A new region with same dimensions that fits with inside container.

    +
    + + + + -
    +
    -

    - union + union + - cached -

    -
    union(region)
    -
    + +
    union(region)
    +
    + +
    + +

    Get the smallest region that contains both regions.

    + -
    - -

    Get the smallest region that contains both regions.

    - -

    Parameters:

    - - - - - - - - - - +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    region - Region -

    Another region.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    region +

    + Region + +
    +

    Another region.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Region -

    An optimally sized region to cover both regions.

    TypeDescription
    + + + + + Region + + +
    +

    An optimally sized region to cover both regions.

    +
    + + + + -
    +
    @@ -10930,7 +12901,7 @@

    -
    +
    @@ -10939,18 +12910,20 @@

    - Size + Size

    -
    -

    - Bases: NamedTuple

    +
    +

    + Bases: NamedTuple

    + + + +

    The dimensions (width and height) of a rectangular region.

    - -

    The dimensions (width and height) of a rectangular region.

    Example @@ -10966,7 +12939,11 @@

    - + + + + +
    @@ -10981,21 +12958,21 @@

    - area + area + - property

    -
    area: int
    +
    area
     
    -
    - -

    The area occupied by a region of this size.

    -
    +
    + +

    The area occupied by a region of this size.

    +
    @@ -11004,22 +12981,22 @@

    - height + height + - - instance-attribute class-attribute + instance-attribute

    -
    height: int = 0
    +
    height = 0
     
    -
    - -

    The height in cells.

    -
    +
    + +

    The height in cells.

    +
    @@ -11028,21 +13005,21 @@

    - line_range + line_range + - property

    -
    line_range: range
    +
    line_range
     
    -
    - -

    A range object that covers values between 0 and height.

    -
    +
    + +

    A range object that covers values between 0 and height.

    +
    @@ -11051,21 +13028,21 @@

    - region + region + - property

    -
    region: Region
    +
    region
     
    -
    - -

    A region of the same size, at the origin.

    -
    +
    + +

    A region of the same size, at the origin.

    +
    @@ -11074,22 +13051,22 @@

    - width + width + - - instance-attribute class-attribute + instance-attribute

    -
    width: int = 0
    +
    width = 0
     
    -
    - -

    The width in cells.

    -
    +
    + +

    The width in cells.

    +
    @@ -11098,320 +13075,381 @@

    -

    - clamp_offset + clamp_offset

    -
    clamp_offset(offset)
    +
    clamp_offset(offset)
     
    -
    - -

    Clamp an offset to fit within the width x height.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Clamp an offset to fit within the width x height.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    offset - Offset -

    An offset.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    offset +

    + Offset + +
    +

    An offset.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Offset -

    A new offset that will fit inside the dimensions defined in the Size.

    TypeDescription
    + + + + + Offset + + +
    +

    A new offset that will fit inside the dimensions defined in the Size.

    +
    + + + + -
    +
    -

    - contains + contains

    -
    contains(x, y)
    +
    contains(x, y)
     
    -
    - -

    Check if a point is in area defined by the size.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Check if a point is in area defined by the size.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    x - int -

    X coordinate.

    - required -
    + - - - - + + + + - -
    y - int -

    Y coordinate.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    x +

    + int + +
    +

    X coordinate.

    +
    +
    + required +
    +

    y +

    + int + +
    +

    Y coordinate.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the point is within the region.

    TypeDescription
    + + + + + bool + + +
    +

    True if the point is within the region.

    +
    + + + + -
    +
    -

    - contains_point + contains_point

    -
    contains_point(point)
    +
    contains_point(point)
     
    -
    - -

    Check if a point is in the area defined by the size.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Check if a point is in the area defined by the size.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    point - tuple[int, int] -

    A tuple of x and y coordinates.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    point +

    + tuple[int, int] + +
    +

    A tuple of x and y coordinates.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the point is within the region.

    TypeDescription
    + + + + + bool + + +
    +

    True if the point is within the region.

    +
    + + + + -
    +
    -

    - with_height + with_height

    -
    with_height(height)
    +
    with_height(height)
     
    -
    - -

    Get a new Size with just the height changed.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get a new Size with just the height changed.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    height - int -

    New height.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    height +

    + int + +
    +

    New height.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Size -

    New Size instance.

    TypeDescription
    + + + + + Size + + +
    +

    New Size instance.

    +
    + + + + -
    +
    -

    - with_width + with_width

    -
    with_width(width)
    +
    with_width(width)
     
    -
    - -

    Get a new Size with just the width changed.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get a new Size with just the width changed.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    width - int -

    New width.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    width +

    + int + +
    +

    New width.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Size -

    New Size instance.

    TypeDescription
    + + + + + Size + + +
    +

    New Size instance.

    +
    + + + + -
    +
    @@ -11419,7 +13457,7 @@

    -
    +
    @@ -11428,18 +13466,19 @@

    - Spacing + Spacing

    -
    -

    - Bases: NamedTuple

    +
    +

    + Bases: NamedTuple

    - -

    Stores spacing around a widget, such as padding and border.

    + + +

    Stores spacing around a widget, such as padding and border.

    Spacing is defined by four integers for the space at the top, right, bottom, and left of a region.

    ┌ ─ ─ ─ ─ ─ ─ ─▲─ ─ ─ ─ ─ ─ ─ ─ ┐
                    │ top
    @@ -11452,6 +13491,7 @@ 

    └ ─ ─ ─ ─ ─ ─ ─▼─ ─ ─ ─ ─ ─ ─ ─ ┘

    +
    Example
    >>> from textual.geometry import Region, Spacing
    @@ -11467,7 +13507,11 @@ 

    - + + + + +
    @@ -11482,22 +13526,22 @@

    - bottom + bottom + - - instance-attribute class-attribute + instance-attribute

    -
    bottom: int = 0
    +
    bottom = 0
     
    -
    - -

    Space from the bottom of a region.

    -
    +
    + +

    Space from the bottom of a region.

    +
    @@ -11506,21 +13550,21 @@

    - bottom_right + bottom_right + - property

    -
    bottom_right: tuple[int, int]
    +
    bottom_right
     
    -
    - -

    A pair of integers for the right, and bottom space.

    -
    +
    + +

    A pair of integers for the right, and bottom space.

    +
    @@ -11529,22 +13573,22 @@

    - css + css + - property

    -
    css: str
    +
    css
     
    -
    - -

    A string containing the spacing in CSS format.

    +
    + +

    A string containing the spacing in CSS format.

    For example: "1" or "2 4" or "4 2 8 2".

    -
    +
    @@ -11553,21 +13597,21 @@

    - height + height + - property

    -
    height: int
    +
    height
     
    -
    - -

    Total space in the y axis.

    -
    +
    + +

    Total space in the y axis.

    +
    @@ -11576,22 +13620,22 @@

    - left + left + - - instance-attribute class-attribute + instance-attribute

    -
    left: int = 0
    +
    left = 0
     
    -
    - -

    Space from the left of a region.

    -
    +
    + +

    Space from the left of a region.

    +
    @@ -11600,21 +13644,21 @@

    - max_height + max_height + - property

    -
    max_height: int
    +
    max_height
     
    -
    - -

    The space between regions in the Y direction if margins overlap, i.e. max(self.top, self.bottom).

    -
    +
    + +

    The space between regions in the Y direction if margins overlap, i.e. max(self.top, self.bottom).

    +
    @@ -11623,21 +13667,21 @@

    - max_width + max_width + - property

    -
    max_width: int
    +
    max_width
     
    -
    - -

    The space between regions in the X direction if margins overlap, i.e. max(self.left, self.right).

    -
    +
    + +

    The space between regions in the X direction if margins overlap, i.e. max(self.left, self.right).

    +
    @@ -11646,22 +13690,22 @@

    - right + right + - - instance-attribute class-attribute + instance-attribute

    -
    right: int = 0
    +
    right = 0
     
    -
    - -

    Space from the right of a region.

    -
    +
    + +

    Space from the right of a region.

    +
    @@ -11670,22 +13714,22 @@

    - top + top + - - instance-attribute class-attribute + instance-attribute

    -
    top: int = 0
    +
    top = 0
     
    -
    - -

    Space from the top of a region.

    -
    +
    + +

    Space from the top of a region.

    +
    @@ -11694,21 +13738,21 @@

    - top_left + top_left + - property

    -
    top_left: tuple[int, int]
    +
    top_left
     
    -
    - -

    A pair of integers for the left, and top space.

    -
    +
    + +

    A pair of integers for the left, and top space.

    +
    @@ -11717,21 +13761,21 @@

    - totals + totals + - property

    -
    totals: tuple[int, int]
    +
    totals
     
    -
    - -

    A pair of integers for the total horizontal and vertical space.

    -
    +
    + +

    A pair of integers for the total horizontal and vertical space.

    +
    @@ -11740,21 +13784,21 @@

    - width + width + - property

    -
    width: int
    +
    width
     
    -
    - -

    Total space in the x axis.

    -
    +
    + +

    Total space in the x axis.

    +
    @@ -11763,346 +13807,406 @@

    -

    - all + all + - classmethod

    -
    all(amount)
    +
    all(amount)
     
    -
    - -

    Construct a Spacing with a given amount of spacing on all edges.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Construct a Spacing with a given amount of spacing on all edges.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    amount - int -

    The magnitude of spacing to apply to all edges.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    amount +

    + int + +
    +

    The magnitude of spacing to apply to all edges.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Spacing -

    Spacing(amount, amount, amount, amount)

    TypeDescription
    + + + + + Spacing + + +
    +

    Spacing(amount, amount, amount, amount)

    +
    + + + + -
    +
    -

    - grow_maximum + grow_maximum

    -
    grow_maximum(other)
    +
    grow_maximum(other)
     
    -
    - -

    Grow spacing with a maximum.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Grow spacing with a maximum.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    other - Spacing -

    Spacing object.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    other +

    + Spacing + +
    +

    Spacing object.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Spacing -

    New spacing where the values are maximum of the two values.

    TypeDescription
    + + + + + Spacing + + +
    +

    New spacing where the values are maximum of the two values.

    +
    + + + + -
    +
    -

    - horizontal + horizontal + - classmethod

    -
    horizontal(amount)
    +
    horizontal(amount)
     
    -
    - -

    Construct a Spacing with a given amount of spacing on horizontal edges, +

    + +

    Construct a Spacing with a given amount of spacing on horizontal edges, and no vertical spacing.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    amount - int -

    The magnitude of spacing to apply to horizontal edges.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    amount +

    + int + +
    +

    The magnitude of spacing to apply to horizontal edges.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Spacing -

    Spacing(0, amount, 0, amount)

    TypeDescription
    + + + + + Spacing + + +
    +

    Spacing(0, amount, 0, amount)

    +
    + + + + -
    +
    -

    - unpack + unpack + - classmethod

    -
    unpack(pad)
    +
    unpack(pad)
     
    -
    - -

    Unpack padding specified in CSS style.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Unpack padding specified in CSS style.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    pad - SpacingDimensions -

    An integer, or tuple of 1, 2, or 4 integers.

    - required - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    pad +

    + SpacingDimensions + +
    +

    An integer, or tuple of 1, 2, or 4 integers.

    +
    +
    + required +
    + + +

    Raises:

    + + - - + + - -
    - ValueError -

    If pad is an invalid value.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + ValueError + +
    +

    If pad is an invalid value.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - Spacing -

    New Spacing object.

    TypeDescription
    + + + + + Spacing + + +
    +

    New Spacing object.

    +
    + + + + -
    +
    -

    - vertical + vertical + - classmethod

    -
    vertical(amount)
    +
    vertical(amount)
     
    -
    - -

    Construct a Spacing with a given amount of spacing on vertical edges, +

    + +

    Construct a Spacing with a given amount of spacing on vertical edges, and no horizontal spacing.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    amount - int -

    The magnitude of spacing to apply to vertical edges.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    amount +

    + int + +
    +

    The magnitude of spacing to apply to vertical edges.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Spacing -

    Spacing(amount, 0, amount, 0)

    TypeDescription
    + + + + + Spacing + + +
    +

    Spacing(amount, 0, amount, 0)

    +
    + + + + -
    +
    @@ -12110,7 +14214,7 @@

    -
    +

    @@ -12118,86 +14222,109 @@

    -

    - clamp + clamp

    -
    clamp(value, minimum, maximum)
    +
     
    -  
    - -

    Restrict a value to a given range.

    +
    + +

    Restrict a value to a given range.

    If value is less than the minimum, return the minimum. If value is greater than the maximum, return the maximum. Otherwise, return value.

    The minimum and maximum arguments values may be given in reverse order.

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    value - T -

    A value.

    - required -
    minimum - T -

    Minimum value.

    - required -
    + - - - - + + + + - -
    maximum - T -

    Maximum value.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    value +

    + T + +
    +

    A value.

    +
    +
    + required +
    +

    minimum +

    + T + +
    +

    Minimum value.

    +
    +
    + required +
    +

    maximum +

    + T + +
    +

    Maximum value.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - T -

    New value that is not less than the minimum or greater than the maximum.

    TypeDescription
    + + + + + T + + +
    +

    New value that is not less than the minimum or greater than the maximum.

    +
    + + + + -
    +
    @@ -12205,7 +14332,7 @@

    -

    +
    diff --git a/api/lazy/index.html b/api/lazy/index.html index 1941784890..308a0fdcc6 100644 --- a/api/lazy/index.html +++ b/api/lazy/index.html @@ -5313,7 +5313,7 @@
  • - textual.lazy +  lazy @@ -5322,10 +5322,25 @@
  • - Lazy +  Lazy + + + + +
  • @@ -6423,7 +6438,7 @@
  • - textual.lazy +  lazy @@ -6432,10 +6447,25 @@
  • - Lazy +  Lazy + + + + +
  • @@ -6461,12 +6491,18 @@

    textual.lazy

    + -
    - -

    Tools for lazy loading widgets.

    +
    + +

    Tools for lazy loading widgets.

    + + + + + + -
    @@ -6482,19 +6518,20 @@

    textual.lazy

    - Lazy + Lazy

    -
    Lazy(widget)
    +
    Lazy(widget)
     
    -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    Wraps a widget so that it is mounted lazily.

    + + +

    Wraps a widget so that it is mounted lazily.

    Lazy widgets are mounted after the first refresh. This can be used to display some parts of the UI very quickly, followed by the lazy widgets. Technically, this won't make anything faster, but it reduces the time the user sees a blank screen and will make apps feel @@ -6503,6 +6540,7 @@

    Note that since lazy widgets aren't mounted immediately (by definition), they will not appear in queries for a brief interval until they are mounted. Your code should take this in to account.

    +
    Example
    def compose(self) -> ComposeResult:
    @@ -6512,34 +6550,45 @@ 

    yield Lazy(NamedColorsView())

    - -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    widget - Widget -

    A widget that should be mounted after a refresh.

    - required - NameTypeDescriptionDefault
    + + + + +

    widget +

    + + Widget + + +
    +

    A widget that should be mounted after a refresh.

    +
    + + + required + + + + + + + + + + -
    @@ -6555,7 +6604,7 @@

    -
    +
    @@ -6564,7 +6613,7 @@

    -
    +
    diff --git a/api/logger/index.html b/api/logger/index.html index 8899382d15..3eefb8cf02 100644 --- a/api/logger/index.html +++ b/api/logger/index.html @@ -5334,7 +5334,7 @@
  • - textual +  textual @@ -5343,7 +5343,7 @@
  • - log +  log @@ -5352,17 +5352,17 @@
  • - Logger +  Logger -
  • - LoggerError +  LoggerError @@ -5466,19 +5481,121 @@
  • - on() +  on + + + + +
  • - work() +  work + + + + +
  • @@ -6555,7 +6672,7 @@
  • - textual +  textual @@ -6564,7 +6681,7 @@
  • - log +  log @@ -6573,17 +6690,17 @@
  • - Logger +  Logger -
  • - LoggerError +  LoggerError @@ -6687,19 +6819,121 @@
  • - on() +  on + + + + +
  • - work() +  work + + + + +
  • @@ -6725,13 +6959,19 @@

    textual

    + -
    - -

    The root Textual module.

    +
    + +

    The root Textual module.

    Exposes some commonly used symbols.

    - + + + + + +
    @@ -6746,27 +6986,28 @@

    textual

    - log + log + - module-attribute

    -
    log = Logger(None)
    +
    log = Logger(None)
     
    -
    - -

    Global logger that logs to the currently active app.

    +
    + +

    Global logger that logs to the currently active app.

    +
    Example
    from textual import log
     log(locals())
     
    -
    +
    @@ -6776,25 +7017,26 @@

    - Logger + Logger

    -
    Logger(
    -    log_callable,
    -    group=LogGroup.INFO,
    -    verbosity=LogVerbosity.NORMAL,
    -)
    +
    Logger(log_callable, group=INFO, verbosity=NORMAL)
     
    -
    +
    + + + +

    A logger class that logs to the Textual console.

    + + + + - -

    A logger class that logs to the Textual console.

    -
    @@ -6809,21 +7051,21 @@

    - debug + debug + - property

    -
    debug: Logger
    +
    debug
     
    -
    - -

    Logs debug messages.

    -
    +
    + +

    Logs debug messages.

    +
    @@ -6832,21 +7074,21 @@

    - error + error + - property

    -
    error: Logger
    +
    error
     
    -
    - -

    Logs errors.

    -
    +
    + +

    Logs errors.

    +
    @@ -6855,21 +7097,21 @@

    - event + event + - property

    -
    event: Logger
    +
    event
     
    -
    - -

    Logs events.

    -
    +
    + +

    Logs events.

    +
    @@ -6878,21 +7120,21 @@

    - info + info + - property

    -
    info: Logger
    +
    info
     
    -
    - -

    Logs information.

    -
    +
    + +

    Logs information.

    +
    @@ -6901,21 +7143,21 @@

    - logging + logging + - property

    -
    logging: Logger
    +
    logging
     
    -
    - -

    Logs from stdlib logging module.

    -
    +
    + +

    Logs from stdlib logging module.

    +
    @@ -6924,21 +7166,21 @@

    - system + system + - property

    -
    system: Logger
    +
    system
     
    -
    - -

    Logs system information.

    -
    +
    + +

    Logs system information.

    +
    @@ -6947,21 +7189,21 @@

    - verbose + verbose + - property

    -
    verbose: Logger
    +
    verbose
     
    -
    - -

    A verbose logger.

    -
    +
    + +

    A verbose logger.

    +
    @@ -6970,21 +7212,21 @@

    - warning + warning + - property

    -
    warning: Logger
    +
    warning
     
    -
    - -

    Logs warnings.

    -
    +
    + +

    Logs warnings.

    +
    @@ -6993,21 +7235,21 @@

    - worker + worker + - property

    -
    worker: Logger
    +
    worker
     
    -
    - -

    Logs worker information.

    -
    +
    + +

    Logs worker information.

    +
    @@ -7016,62 +7258,73 @@

    -

    - verbosity + verbosity

    -
    verbosity(verbose)
    +
    verbosity(verbose)
     
    -
    - -

    Get a new logger with selective verbosity.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get a new logger with selective verbosity.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    verbose - bool -

    True to use HIGH verbosity, otherwise NORMAL.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    verbose +

    + bool + +
    +

    True to use HIGH verbosity, otherwise NORMAL.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Logger -

    New logger.

    TypeDescription
    + + + + + Logger + + +
    +

    New logger.

    +
    + + + + -
    +
    @@ -7079,7 +7332,7 @@

    -
    +
    @@ -7088,22 +7341,27 @@

    - LoggerError + LoggerError

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Raised when the logger failed.

    +

    Raised when the logger failed.

    -
    + + + + + + +
    @@ -7111,21 +7369,21 @@

    -

    - on + on

    -
    on(message_type, selector=None, **kwargs)
    +
     
    -  
    - -

    Decorator to declare that the method is a message handler.

    +
    + +

    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 property on the message.

    +
    Example
    # Handle the press of buttons with ID "#quit".
    @@ -7133,9 +7391,10 @@ 

    def quit_button(self) -> None: self.app.quit()

    -

    Keyword arguments can be used to match additional selectors for attributes +

    Keyword arguments can be used to match additional selectors for attributes listed in ALLOW_SELECTOR_MATCH.

    +
    Example
    # Handle the activation of the tab "#home" within the `TabbedContent` "#tabs".
    @@ -7145,167 +7404,261 @@ 

    ...

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    message_type - type[Message] -

    The message type (i.e. the class).

    - required -
    selector - str | None -

    An optional selector. If supplied, the handler will only be called if selector -matches the widget from the control attribute of the message.

    - None -
    + - - - - + + + + - -
    **kwargs - str -

    Additional selectors for other attributes of the message.

    - {} - NameTypeDescriptionDefault
    + + + + +

    message_type +

    + + type[Message] + + +
    +

    The message type (i.e. the class).

    +
    + + + required + + + + +

    selector +

    + + str | None + + +
    +

    An optional selector. If supplied, the handler will only be called if selector +matches the widget from the control attribute of the message.

    +
    + + + None + + + + +

    **kwargs +

    + + str + + +
    +

    Additional selectors for other attributes of the message.

    +
    + + + {} + + + + -
    +
    -

    - work + work

    -
    work(
    -    method=None,
    +          
    +
    work(
    +    method: Callable[
    +        FactoryParamSpec, Coroutine[None, None, ReturnType]
    +    ],
    +    *,
    +    name: str = "",
    +    group: str = "default",
    +    exit_on_error: bool = True,
    +    exclusive: bool = False,
    +    description: str | None = None,
    +    thread: bool = False
    +) -> Callable[FactoryParamSpec, "Worker[ReturnType]"]
    +
    work(
    +    method: Callable[FactoryParamSpec, ReturnType],
         *,
    -    name="",
    -    group="default",
    -    exit_on_error=True,
    -    exclusive=False,
    -    description=None,
    -    thread=False
    +    name: str = "",
    +    group: str = "default",
    +    exit_on_error: bool = True,
    +    exclusive: bool = False,
    +    description: str | None = None,
    +    thread: bool = False
    +) -> Callable[FactoryParamSpec, "Worker[ReturnType]"]
    +
    work(
    +    *,
    +    name: str = "",
    +    group: str = "default",
    +    exit_on_error: bool = True,
    +    exclusive: bool = False,
    +    description: str | None = None,
    +    thread: bool = False
    +) -> Decorator[..., ReturnType]
    +
    +
    work(
    +    method=None,
    +    *,
    +    name="",
    +    group="default",
    +    exit_on_error=True,
    +    exclusive=False,
    +    description=None,
    +    thread=False
     )
     
    -
    - -

    A decorator used to create workers.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    A decorator used to create workers.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    method - Callable[FactoryParamSpec, ReturnType] | Callable[FactoryParamSpec, Coroutine[None, None, ReturnType]] | None -

    A function or coroutine.

    - None -
    name - str -

    A short string to identify the worker (in logs and debugging).

    - '' -
    group - str -

    A short string to identify a group of workers.

    - 'default' -
    exit_on_error - bool -

    Exit the app if the worker raises an error. Set to False to suppress exceptions.

    - True -
    + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - -
    exclusive - bool -

    Cancel all workers in the same group.

    - False - NameTypeDescriptionDefault
    description - str | None -

    Readable description of the worker for debugging purposes. +

    +

    method +

    + Callable[FactoryParamSpec, ReturnType] | Callable[FactoryParamSpec, Coroutine[None, None, ReturnType]] | None + +
    +

    A function or coroutine.

    +
    +
    + None +
    +

    name +

    + str + +
    +

    A short string to identify the worker (in logs and debugging).

    +
    +
    + '' +
    +

    group +

    + str + +
    +

    A short string to identify a group of workers.

    +
    +
    + 'default' +
    +

    exit_on_error +

    + bool + +
    +

    Exit the app if the worker raises an error. Set to False to suppress exceptions.

    +
    +
    + True +
    +

    exclusive +

    + bool + +
    +

    Cancel all workers in the same group.

    +
    +
    + False +
    +

    description +

    + str | None + +
    +

    Readable description of the worker for debugging purposes. By default, it uses a string representation of the decorated method -and its arguments.

    - None -
    thread - bool -

    Mark the method as a thread worker.

    - False -
    +and its arguments.

    +
    + + + None + + + + +

    thread +

    + + bool + + +
    +

    Mark the method as a thread worker.

    +
    + + + False + + + + -
    +
    @@ -7313,7 +7666,7 @@

    -
    +
    diff --git a/api/logging/index.html b/api/logging/index.html index ad6457eeb5..9873393465 100644 --- a/api/logging/index.html +++ b/api/logging/index.html @@ -5355,7 +5355,7 @@
  • - textual.logging +  logging @@ -5364,17 +5364,35 @@
  • - TextualHandler +  TextualHandler -
  • -
    -
    + + + + +
  • + + +  prevent + + + +
  • + +
  • + + +  set_interval + + + + + +
  • + +
  • + + +  set_timer + + + + + +
  • + + + + + + + + + +
    +
    +
    @@ -6851,16 +7289,22 @@

    textual.message_pump

    + -
    - -

    A MessagePump is a base class for any object which processes messages, which includes Widget, Screen, and App.

    +
    + +

    A MessagePump is a base class for any object which processes messages, which includes Widget, Screen, and App.

    Tip

    Most of the method here are useful in general app development.

    - + + + + + +
    @@ -6876,21 +7320,26 @@

    textual.message_pump

    - MessagePump + MessagePump

    -
    MessagePump(parent=None)
    +
    MessagePump(parent=None)
     
    -
    +
    + + + +

    Base class which supplies a message pump.

    + + + + - -

    Base class which supplies a message pump.

    -
    @@ -6905,57 +7354,67 @@

    - app + app + - property

    -
    app: 'App[object]'
    +
    app
     
    -
    - -

    Get the current app.

    +
    + +

    Get the current app.

    + -

    Returns:

    - - - - - - - - +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - 'App[object]' -

    The current app.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + 'App[object]' + +
    +

    The current app.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - NoActiveAppError -

    if no active app could be found for the current asyncio context

    TypeDescription
    -
    + + + + + NoActiveAppError + + +
    +

    if no active app could be found for the current asyncio context

    +
    + + + + +
    @@ -6964,21 +7423,21 @@

    - has_parent + has_parent + - property

    -
    has_parent: bool
    +
    has_parent
     
    -
    - -

    Does this object have a parent?

    -
    +
    + +

    Does this object have a parent?

    +
    @@ -6987,21 +7446,21 @@

    - is_attached + is_attached + - property

    -
    is_attached: bool
    +
    is_attached
     
    -
    - -

    Is this node linked to the app through the DOM?

    -
    +
    + +

    Is this node linked to the app through the DOM?

    +
    @@ -7010,21 +7469,21 @@

    - is_dom_root + is_dom_root + - property

    -
    is_dom_root
    +
    is_dom_root
     
    -
    - -

    Is this a root node (i.e. the App)?

    -
    +
    + +

    Is this a root node (i.e. the App)?

    +
    @@ -7033,21 +7492,21 @@

    - is_parent_active + is_parent_active + - property

    -
    is_parent_active: bool
    +
    is_parent_active
     
    -
    - -

    Is the parent active?

    -
    +
    + +

    Is the parent active?

    +
    @@ -7056,21 +7515,21 @@

    - is_running + is_running + - property

    -
    is_running: bool
    +
    is_running
     
    -
    - -

    Is the message pump running (potentially processing messages)?

    -
    +
    + +

    Is the message pump running (potentially processing messages)?

    +
    @@ -7079,39 +7538,44 @@

    - log + log + - property

    -
    log: Logger
    +
    log
     
    -
    - -

    Get a logger for this object.

    +
    + +

    Get a logger for this object.

    + -

    Returns:

    - - - - - - - - +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Logger -

    A logger.

    TypeDescription
    -
    + + + + + Logger + + +
    +

    A logger.

    +
    + + + + +
    @@ -7120,21 +7584,21 @@

    - message_queue_size + message_queue_size + - property

    -
    message_queue_size: int
    +
    message_queue_size
     
    -
    - -

    The current size of the message queue.

    -
    +
    + +

    The current size of the message queue.

    +
    @@ -7143,22 +7607,22 @@

    - message_signal + message_signal + - instance-attribute

    -
    message_signal: Signal[Message] = Signal(self, 'messages')
    +
    message_signal = Signal(self, 'messages')
     
    -
    - -

    Subscribe to this signal to be notified of all messages sent to this widget.

    +
    + +

    Subscribe to this signal to be notified of all messages sent to this widget.

    This is a fairly low-level mechanism, and shouldn't replace regular message handling.

    -
    +
    @@ -7167,462 +7631,539 @@

    -

    - call_after_refresh + call_after_refresh

    -
    call_after_refresh(callback, *args, **kwargs)
    +
    call_after_refresh(callback, *args, **kwargs)
     
    -
    - -

    Schedule a callback to run after all messages are processed and the screen +

    + +

    Schedule a callback to run after all messages are processed and the screen has been refreshed. Positional and keyword arguments are passed to the callable.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    callback - Callback -

    A callable.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    callback +

    + Callback + +
    +

    A callable.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the callback was scheduled, or False if the callback could not be -scheduled (may occur if the message pump was closed or closing).

    TypeDescription
    + + + + + bool + + +
    +

    True if the callback was scheduled, or False if the callback could not be +scheduled (may occur if the message pump was closed or closing).

    +
    + + + + -
    +
    -

    - call_later + call_later

    -
    call_later(callback, *args, **kwargs)
    +
    call_later(callback, *args, **kwargs)
     
    -
    - -

    Schedule a callback to run after all messages are processed in this object. +

    + +

    Schedule a callback to run after all messages are processed in this object. Positional and keywords arguments are passed to the callable.

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    callback - Callback -

    Callable to call next.

    - required -
    *args - Any -

    Positional arguments to pass to the callable.

    - () -
    + - - - - + + + + - -
    **kwargs - Any -

    Keyword arguments to pass to the callable.

    - {} - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    callback +

    + Callback + +
    +

    Callable to call next.

    +
    +
    + required +
    +

    *args +

    + Any + +
    +

    Positional arguments to pass to the callable.

    +
    +
    + () +
    +

    **kwargs +

    + Any + +
    +

    Keyword arguments to pass to the callable.

    +
    +
    + {} +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the callback was scheduled, or False if the callback could not be -scheduled (may occur if the message pump was closed or closing).

    TypeDescription
    + + + + + bool + + +
    +

    True if the callback was scheduled, or False if the callback could not be +scheduled (may occur if the message pump was closed or closing).

    +
    + + + + -
    +
    -

    - call_next + call_next

    -
    call_next(callback, *args, **kwargs)
    +
    call_next(callback, *args, **kwargs)
     
    -
    - -

    Schedule a callback to run immediately after processing the current message.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Schedule a callback to run immediately after processing the current message.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    callback - Callback -

    Callable to run after current event.

    - required -
    *args - Any -

    Positional arguments to pass to the callable.

    - () -
    + - - - - + + + + - -
    **kwargs - Any -

    Keyword arguments to pass to the callable.

    - {} - NameTypeDescriptionDefault
    + + + + +

    callback +

    + + Callback + + +
    +

    Callable to run after current event.

    +
    + + + required + + + + +

    *args +

    + + Any + + +
    +

    Positional arguments to pass to the callable.

    +
    + + + () + + + + +

    **kwargs +

    + + Any + + +
    +

    Keyword arguments to pass to the callable.

    +
    + + + {} + + + + -
    +
    -

    - check_idle + check_idle

    -
    check_idle()
    +
    check_idle()
     
    -
    - -

    Prompt the message pump to call idle if the queue is empty.

    +
    -
    +

    Prompt the message pump to call idle if the queue is empty.

    + +
    -

    - check_message_enabled + check_message_enabled

    -
    check_message_enabled(message)
    +
    check_message_enabled(message)
     
    -
    - -

    Check if a given message is enabled (allowed to be sent).

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Check if a given message is enabled (allowed to be sent).

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    message - Message -

    A message object.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    message +

    + Message + +
    +

    A message object.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the message will be sent, or False if it is disabled.

    TypeDescription
    + + + + + bool + + +
    +

    True if the message will be sent, or False if it is disabled.

    +
    + + + + -
    +
    -

    - disable_messages + disable_messages

    -
    disable_messages(*messages)
    +
    disable_messages(*messages)
     
    -
    - -

    Disable message types from being processed.

    +
    -
    +

    Disable message types from being processed.

    + +
    -

    - enable_messages + enable_messages

    -
    enable_messages(*messages)
    +
    enable_messages(*messages)
     
    -
    - -

    Enable processing of messages types.

    +
    -
    +

    Enable processing of messages types.

    + +
    -

    - on_event + on_event + - async

    -
    on_event(event)
    +
    on_event(event)
     
    -
    - -

    Called to process an event.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Called to process an event.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    event - events.Event -

    An Event object.

    - required - NameTypeDescriptionDefault
    + + + + +

    event +

    + + Event + + +
    +

    An Event object.

    +
    + + + required + + + + -
    +
    -

    - post_message + post_message

    -
    post_message(message)
    +
    post_message(message)
     
    -
    - -

    Posts a message on to this widget's queue.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Posts a message on to this widget's queue.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    message - Message -

    A message (including Event).

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    message +

    + Message + +
    +

    A message (including Event).

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the messages was processed, False if it wasn't.

    TypeDescription
    + + + + + bool + + +
    +

    True if the messages was processed, False if it wasn't.

    +
    + + + + -
    +
    -

    - prevent + prevent

    -
    prevent(*message_types)
    +
    prevent(*message_types)
     
    -
    - -

    A context manager to temporarily prevent the given message types from being posted.

    +
    + +

    A context manager to temporarily prevent the given message types from being posted.

    +
    Example @@ -7631,134 +8172,169 @@

    input.value = "foo"

    -
    +
    -

    - set_interval + set_interval

    -
    set_interval(
    -    interval,
    -    callback=None,
    +
    set_interval(
    +    interval,
    +    callback=None,
         *,
    -    name=None,
    -    repeat=0,
    -    pause=False
    +    name=None,
    +    repeat=0,
    +    pause=False
     )
     
    -
    - -

    Call a function at periodic intervals.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Call a function at periodic intervals.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    interval - float -

    Time (in seconds) between calls.

    - required -
    callback - TimerCallback | None -

    Function to call.

    - None -
    name - str | None -

    Name of the timer object.

    - None -
    repeat - int -

    Number of times to repeat the call or 0 for continuous.

    - 0 -
    + - - - - + + + + - -
    pause - bool -

    Start the timer paused.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    interval +

    + float + +
    +

    Time (in seconds) between calls.

    +
    +
    + required +
    +

    callback +

    + TimerCallback | None + +
    +

    Function to call.

    +
    +
    + None +
    +

    name +

    + str | None + +
    +

    Name of the timer object.

    +
    +
    + None +
    +

    repeat +

    + int + +
    +

    Number of times to repeat the call or 0 for continuous.

    +
    +
    + 0 +
    +

    pause +

    + bool + +
    +

    Start the timer paused.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Timer -

    A timer object.

    TypeDescription
    + + + + + Timer + + +
    +

    A timer object.

    +
    + + + + -
    +
    -

    - set_timer + set_timer

    -
    set_timer(delay, callback=None, *, name=None, pause=False)
    +
    set_timer(delay, callback=None, *, name=None, pause=False)
     
    -
    - -

    Call a function after a delay.

    +
    + +

    Call a function after a delay.

    +
    Example @@ -7768,79 +8344,109 @@

    self.set_timer(3 * 60, ready)

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    delay - float -

    Time (in seconds) to wait before invoking callback.

    - required -
    callback - TimerCallback | None -

    Callback to call after time has expired.

    - None -
    name - str | None -

    Name of the timer (for debug).

    - None -
    + - - - - + + + + - -
    pause - bool -

    Start timer paused.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    delay +

    + float + +
    +

    Time (in seconds) to wait before invoking callback.

    +
    +
    + required +
    +

    callback +

    + TimerCallback | None + +
    +

    Callback to call after time has expired.

    +
    +
    + None +
    +

    name +

    + str | None + +
    +

    Name of the timer (for debug).

    +
    +
    + None +
    +

    pause +

    + bool + +
    +

    Start timer paused.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Timer -

    A timer object.

    TypeDescription
    + + + + + Timer + + +
    +

    A timer object.

    +
    + + + + -
    +
    @@ -7848,7 +8454,7 @@

    -
    +
    @@ -7857,7 +8463,7 @@

    -
    +
    diff --git a/api/on/index.html b/api/on/index.html index 4fa4771232..bb8d794aa2 100644 --- a/api/on/index.html +++ b/api/on/index.html @@ -5443,7 +5443,34 @@
  • - textual.on +  on + + + +
  • + +
  • + + +  message_type + + + +
  • + +
  • + + +  selector + + + +
  • + +
  • + + +  **kwargs @@ -6420,7 +6447,34 @@
  • - textual.on +  on + + + +
  • + +
  • + + +  message_type + + + +
  • + +
  • + + +  selector + + + +
  • + +
  • + + +  **kwargs @@ -6450,13 +6504,15 @@

    On
    + -
    - -

    Decorator to declare that the method is a message handler.

    +
    + +

    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 property on the message.

    +
    Example
    # Handle the press of buttons with ID "#quit".
    @@ -6464,9 +6520,10 @@ 

    On def quit_button(self) -> None: self.app.quit()

    -

    Keyword arguments can be used to match additional selectors for attributes +

    Keyword arguments can be used to match additional selectors for attributes listed in ALLOW_SELECTOR_MATCH.

    +
    Example
    # Handle the activation of the tab "#home" within the `TabbedContent` "#tabs".
    @@ -6476,52 +6533,71 @@ 

    On ...

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    message_type - type[Message] -

    The message type (i.e. the class).

    - required -
    selector - str | None -

    An optional selector. If supplied, the handler will only be called if selector -matches the widget from the control attribute of the message.

    - None -
    + - - - - + + + + - -
    **kwargs - str -

    Additional selectors for other attributes of the message.

    - {} - NameTypeDescriptionDefault
    + + + + +

    message_type +

    + + type[Message] + + +
    +

    The message type (i.e. the class).

    +
    + + + required + + + + +

    selector +

    + + str | None + + +
    +

    An optional selector. If supplied, the handler will only be called if selector +matches the widget from the control attribute of the message.

    +
    + + + None + + + + +

    **kwargs +

    + + str + + +
    +

    Additional selectors for other attributes of the message.

    +
    + + + {} + + + + -
    +
    diff --git a/api/pilot/index.html b/api/pilot/index.html index 30708755ba..c7aed174e5 100644 --- a/api/pilot/index.html +++ b/api/pilot/index.html @@ -5460,7 +5460,7 @@
  • - textual.pilot +  pilot @@ -5469,7 +5469,7 @@
  • - OutOfBounds +  OutOfBounds @@ -5478,17 +5478,17 @@
  • - Pilot +  Pilot -
  • + +
  • + + +  WaitForScreenTimeout + + + +
  • + + + + + + + + + + +
    +
    + @@ -6707,13 +7199,19 @@

    textual.pilot

    + -
    - -

    This module contains the Pilot class used by App.run_test to programmatically operate an app.

    +
    + +

    This module contains the Pilot class used by App.run_test to programmatically operate an app.

    See the guide on how to test Textual apps.

    - + + + + + +
    @@ -6729,22 +7227,27 @@

    textual.pilot

    - OutOfBounds + OutOfBounds

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    + + + +

    Raised when the pilot mouse target is outside of the (visible) screen.

    + - -

    Raised when the pilot mouse target is outside of the (visible) screen.

    -
    + + +
    @@ -6753,23 +7256,28 @@

    - Pilot + Pilot

    -
    Pilot(app)
    +
    Pilot(app)
     
    -
    -

    - Bases: Generic[ReturnType]

    +
    +

    + Bases: Generic[ReturnType]

    + + + +

    Pilot object to drive an app.

    + + + + - -

    Pilot object to drive an app.

    -
    @@ -6784,21 +7292,21 @@

    - app + app + - property

    -
    app: App[ReturnType]
    +
    app
     
    -
    - - -
    +
    + + +
    @@ -6807,31 +7315,31 @@

    -

    - click + click + - async

    -
    click(
    -    widget=None,
    -    offset=(0, 0),
    -    shift=False,
    -    meta=False,
    -    control=False,
    +
    click(
    +    widget=None,
    +    offset=(0, 0),
    +    shift=False,
    +    meta=False,
    +    control=False,
     )
     
    -
    - -

    Simulate clicking with the mouse at a specified position.

    +
    + +

    Simulate clicking with the mouse at a specified position.

    The final position to be clicked is computed based on the selector provided and the offset specified and it must be within the visible area of the screen.

    +
    Example

    The code below runs an app and clicks its only button right in the middle: @@ -6839,741 +7347,912 @@

    await pilot.click(Button, offset=(8, 1))

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    widget - Widget | type[Widget] | str | None -

    A widget or selector used as an origin +

    NameTypeDescriptionDefault
    +

    widget +

    + Widget | type[Widget] | str | None + +
    +

    A widget or selector used as an origin for the click offset. If this is not specified, the offset is interpreted relative to the screen. You can use this parameter to try to click on a specific widget. However, if the widget is currently hidden or obscured by -another widget, the click may not land on the widget you specified.

    - None -
    offset - tuple[int, int] -

    The offset to click. The offset is relative to the widget / selector provided -or to the screen, if no selector is provided.

    - (0, 0) -
    shift - bool -

    Click with the shift key held down.

    - False -
    meta - bool -

    Click with the meta key held down.

    - False -
    control - bool -

    Click with the control key held down.

    - False -
    - -

    Raises:

    - - - - - - - - +another widget, the click may not land on the widget you specified.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + None +
    +

    offset +

    + tuple[int, int] + +
    +

    The offset to click. The offset is relative to the widget / selector provided +or to the screen, if no selector is provided.

    +
    +
    + (0, 0) +
    +

    shift +

    + bool + +
    +

    Click with the shift key held down.

    +
    +
    + False +
    +

    meta +

    + bool + +
    +

    Click with the meta key held down.

    +
    +
    + False +
    +

    control +

    + bool + +
    +

    Click with the control key held down.

    +
    +
    + False +
    + + +

    Raises:

    + + - - + + - -
    - OutOfBounds -

    If the position to be clicked is outside of the (visible) screen.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + OutOfBounds + +
    +

    If the position to be clicked is outside of the (visible) screen.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if no selector was specified or if the click landed on the selected -widget, False otherwise.

    TypeDescription
    + + + + + bool + + +
    +

    True if no selector was specified or if the click landed on the selected +widget, False otherwise.

    +
    + + + + -
    +

    -

    - exit + exit + - async

    -
    exit(result)
    +
    exit(result)
     
    -
    - -

    Exit the app with the given result.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Exit the app with the given result.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    result - ReturnType -

    The app result returned by run or run_async.

    - required - NameTypeDescriptionDefault
    + + + + +

    result +

    + + ReturnType + + +
    +

    The app result returned by run or run_async.

    +
    + + + required + + + + -
    +
    -

    - hover + hover + - async

    -
    hover(widget=None, offset=(0, 0))
    +
    hover(widget=None, offset=(0, 0))
     
    -
    - -

    Simulate hovering with the mouse cursor at a specified position.

    +
    + +

    Simulate hovering with the mouse cursor at a specified position.

    The final position to be hovered is computed based on the selector provided and the offset specified and it must be within the visible area of the screen.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - + + + + + + + + + + - - - - - - - - - -
    widget - Widget | type[Widget] | str | None | None -

    A widget or selector used as an origin +

    NameTypeDescriptionDefault
    +

    widget +

    + Widget | type[Widget] | str | None | None + +
    +

    A widget or selector used as an origin for the hover offset. If this is not specified, the offset is interpreted relative to the screen. You can use this parameter to try to hover a specific widget. However, if the widget is currently hidden or obscured by -another widget, the hover may not land on the widget you specified.

    - None -
    offset - tuple[int, int] -

    The offset to hover. The offset is relative to the widget / selector provided -or to the screen, if no selector is provided.

    - (0, 0) -
    - -

    Raises:

    - - - - - - - - +another widget, the hover may not land on the widget you specified.

    + + + + + + + + + + + +
    TypeDescription
    + None +
    +

    offset +

    + tuple[int, int] + +
    +

    The offset to hover. The offset is relative to the widget / selector provided +or to the screen, if no selector is provided.

    +
    +
    + (0, 0) +
    + + +

    Raises:

    + + - - + + - -
    - OutOfBounds -

    If the position to be hovered is outside of the (visible) screen.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + OutOfBounds + +
    +

    If the position to be hovered is outside of the (visible) screen.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if no selector was specified or if the hover landed on the selected -widget, False otherwise.

    TypeDescription
    + + + + + bool + + +
    +

    True if no selector was specified or if the hover landed on the selected +widget, False otherwise.

    +
    + + + + -
    +
    -

    - mouse_down + mouse_down + - async

    -
    mouse_down(
    -    widget=None,
    -    offset=(0, 0),
    -    shift=False,
    -    meta=False,
    -    control=False,
    +
    mouse_down(
    +    widget=None,
    +    offset=(0, 0),
    +    shift=False,
    +    meta=False,
    +    control=False,
     )
     
    -
    - -

    Simulate a MouseDown event at a specified position.

    +
    + +

    Simulate a MouseDown event at a specified position.

    The final position for the event is computed based on the selector provided and the offset specified and it must be within the visible area of the screen.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    widget - Widget | type[Widget] | str | None -

    A widget or selector used as an origin +

    NameTypeDescriptionDefault
    +

    widget +

    + Widget | type[Widget] | str | None + +
    +

    A widget or selector used as an origin for the event offset. If this is not specified, the offset is interpreted relative to the screen. You can use this parameter to try to target a specific widget. However, if the widget is currently hidden or obscured by -another widget, the event may not land on the widget you specified.

    - None -
    offset - tuple[int, int] -

    The offset for the event. The offset is relative to the selector / widget -provided or to the screen, if no selector is provided.

    - (0, 0) -
    shift - bool -

    Simulate the event with the shift key held down.

    - False -
    meta - bool -

    Simulate the event with the meta key held down.

    - False -
    control - bool -

    Simulate the event with the control key held down.

    - False -
    - -

    Raises:

    - - - - - - - - +another widget, the event may not land on the widget you specified.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + None +
    +

    offset +

    + tuple[int, int] + +
    +

    The offset for the event. The offset is relative to the selector / widget +provided or to the screen, if no selector is provided.

    +
    +
    + (0, 0) +
    +

    shift +

    + bool + +
    +

    Simulate the event with the shift key held down.

    +
    +
    + False +
    +

    meta +

    + bool + +
    +

    Simulate the event with the meta key held down.

    +
    +
    + False +
    +

    control +

    + bool + +
    +

    Simulate the event with the control key held down.

    +
    +
    + False +
    + + +

    Raises:

    + + - - + + - -
    - OutOfBounds -

    If the position for the event is outside of the (visible) screen.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + OutOfBounds + +
    +

    If the position for the event is outside of the (visible) screen.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if no selector was specified or if the event landed on the selected -widget, False otherwise.

    TypeDescription
    + + + + + bool + + +
    +

    True if no selector was specified or if the event landed on the selected +widget, False otherwise.

    +
    + + + + -
    +
    -

    - mouse_up + mouse_up + - async

    -
    mouse_up(
    -    widget=None,
    -    offset=(0, 0),
    -    shift=False,
    -    meta=False,
    -    control=False,
    +
    mouse_up(
    +    widget=None,
    +    offset=(0, 0),
    +    shift=False,
    +    meta=False,
    +    control=False,
     )
     
    -
    - -

    Simulate a MouseUp event at a specified position.

    +
    + +

    Simulate a MouseUp event at a specified position.

    The final position for the event is computed based on the selector provided and the offset specified and it must be within the visible area of the screen.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    widget - Widget | type[Widget] | str | None -

    A widget or selector used as an origin +

    NameTypeDescriptionDefault
    +

    widget +

    + Widget | type[Widget] | str | None + +
    +

    A widget or selector used as an origin for the event offset. If this is not specified, the offset is interpreted relative to the screen. You can use this parameter to try to target a specific widget. However, if the widget is currently hidden or obscured by -another widget, the event may not land on the widget you specified.

    - None -
    offset - tuple[int, int] -

    The offset for the event. The offset is relative to the widget / selector -provided or to the screen, if no selector is provided.

    - (0, 0) -
    shift - bool -

    Simulate the event with the shift key held down.

    - False -
    meta - bool -

    Simulate the event with the meta key held down.

    - False -
    control - bool -

    Simulate the event with the control key held down.

    - False -
    - -

    Raises:

    - - - - - - - - +another widget, the event may not land on the widget you specified.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + None +
    +

    offset +

    + tuple[int, int] + +
    +

    The offset for the event. The offset is relative to the widget / selector +provided or to the screen, if no selector is provided.

    +
    +
    + (0, 0) +
    +

    shift +

    + bool + +
    +

    Simulate the event with the shift key held down.

    +
    +
    + False +
    +

    meta +

    + bool + +
    +

    Simulate the event with the meta key held down.

    +
    +
    + False +
    +

    control +

    + bool + +
    +

    Simulate the event with the control key held down.

    +
    +
    + False +
    + + +

    Raises:

    + + - - + + - -
    - OutOfBounds -

    If the position for the event is outside of the (visible) screen.

    TypeDescription
    - -

    Returns:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + OutOfBounds + +
    +

    If the position for the event is outside of the (visible) screen.

    +
    +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if no selector was specified or if the event landed on the selected -widget, False otherwise.

    TypeDescription
    + + + + + bool + + +
    +

    True if no selector was specified or if the event landed on the selected +widget, False otherwise.

    +
    + + + + -
    +
    -

    - pause + pause + - async

    -
    pause(delay=None)
    +
    pause(delay=None)
     
    -
    - -

    Insert a pause.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Insert a pause.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    delay - float | None -

    Seconds to pause, or None to wait for cpu idle.

    - None - NameTypeDescriptionDefault
    + + + + +

    delay +

    + + float | None + + +
    +

    Seconds to pause, or None to wait for cpu idle.

    +
    + + + None + + + + -
    +
    -

    - press + press + - async

    -
    press(*keys)
    +
    press(*keys)
     
    -
    - -

    Simulate key-presses.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Simulate key-presses.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    *keys - str -

    Keys to press.

    - () - NameTypeDescriptionDefault
    + + + + +

    *keys +

    + + str + + +
    +

    Keys to press.

    +
    + + + () + + + + -
    +
    -

    - resize_terminal + resize_terminal + - async

    -
    resize_terminal(width, height)
    +
    resize_terminal(width, height)
     
    -
    - -

    Resize the terminal to the given dimensions.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Resize the terminal to the given dimensions.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    width - int -

    The new width of the terminal.

    - required -
    + - - - - + + + + - -
    height - int -

    The new height of the terminal.

    - required - NameTypeDescriptionDefault
    + + + + +

    width +

    + + int + + +
    +

    The new width of the terminal.

    +
    + + + required + + + + +

    height +

    + + int + + +
    +

    The new height of the terminal.

    +
    + + + required + + + + -
    +
    -

    - wait_for_animation + wait_for_animation + - async

    -
    wait_for_animation()
    +
    wait_for_animation()
     
    -
    - -

    Wait for any current animation to complete.

    +
    -
    +

    Wait for any current animation to complete.

    + +
    -

    - wait_for_scheduled_animations + wait_for_scheduled_animations + - async

    -
    wait_for_scheduled_animations()
    +
    wait_for_scheduled_animations()
     
    -
    - -

    Wait for any current and scheduled animations to complete.

    +
    -
    +

    Wait for any current and scheduled animations to complete.

    + +
    @@ -7581,7 +8260,7 @@

    - WaitForScreenTimeout + WaitForScreenTimeout

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Exception raised if messages aren't being processed quickly enough.

    + + +

    Exception raised if messages aren't being processed quickly enough.

    If this occurs, the most likely explanation is some kind of deadlock in the app code.

    -
    + + + + +
    @@ -7615,7 +8299,7 @@

    -
    +
    diff --git a/api/query/index.html b/api/query/index.html index 3ee42707d2..d8863d54de 100644 --- a/api/query/index.html +++ b/api/query/index.html @@ -5481,7 +5481,7 @@
  • - textual.css.query +  query @@ -5490,7 +5490,7 @@
  • - ExpectType +  ExpectType @@ -5499,7 +5499,7 @@
  • - QueryType +  QueryType @@ -5508,17 +5508,62 @@
  • - DOMQuery +  DOMQuery -
  • diff --git a/api/renderables/index.html b/api/renderables/index.html index cadd70aeef..db5837cfb4 100644 --- a/api/renderables/index.html +++ b/api/renderables/index.html @@ -5523,7 +5523,7 @@
  • - textual.renderables.bar +  bar @@ -5532,16 +5532,67 @@
  • - Bar +  Bar + +
  • - textual.renderables.blank +  blank @@ -5550,7 +5601,7 @@
  • - Blank +  Blank @@ -5559,7 +5610,7 @@
  • - textual.renderables.digits +  digits @@ -5568,20 +5619,53 @@
  • - Digits +  Digits -
  • diff --git a/api/scrollbar/index.html b/api/scrollbar/index.html index 919ce4758c..9b586a9bde 100644 --- a/api/scrollbar/index.html +++ b/api/scrollbar/index.html @@ -5565,7 +5565,7 @@
  • - textual.scrollbar +  scrollbar @@ -5574,17 +5574,17 @@
  • - ScrollBar +  ScrollBar -
  • @@ -7761,23 +8010,28 @@

    - RenderStyles + RenderStyles

    -
    RenderStyles(node, base, inline_styles)
    +
    RenderStyles(node, base, inline_styles)
     
    -
    -

    - Bases: StylesBase

    +
    +

    + Bases: StylesBase

    + + + +

    Presents a combined view of two Styles object: a base Styles and inline Styles.

    + + + + - -

    Presents a combined view of two Styles object: a base Styles and inline Styles.

    -
    @@ -7791,22 +8045,22 @@

    -

    - base +

    + base + - property -

    -
    base: Styles
    +

    +
    base
     
    -
    - -

    Quick access to base (css) style.

    -
    +
    + +

    Quick access to base (css) style.

    +
    @@ -7814,22 +8068,22 @@

    -

    - css +

    + css + - property -

    -
    css: str
    +
    +
    css
     
    -
    - -

    Get the CSS for the combined styles.

    -
    +
    + +

    Get the CSS for the combined styles.

    +
    @@ -7837,40 +8091,45 @@

    -

    - gutter +

    + gutter + - property -

    -
    gutter: Spacing
    +
    +
    gutter
     
    -
    - -

    Get space around widget.

    +
    -

    Returns:

    - - - - - - - - +

    Get space around widget.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Spacing -

    Space around widget content.

    TypeDescription
    -
    + + + + + Spacing + + +
    +

    Space around widget content.

    +
    + + + + +
    @@ -7878,22 +8137,22 @@

    -

    - inline +

    + inline + - property -

    -
    inline: Styles
    +
    +
    inline
     
    -
    - -

    Quick access to the inline styles.

    -
    +
    + +

    Quick access to the inline styles.

    +
    @@ -7901,22 +8160,22 @@

    -

    - rich_style +

    + rich_style + - property -

    -
    rich_style: Style
    +
    +
    rich_style
     
    -
    - -

    Get a Rich style for this Styles object.

    -
    +
    + +

    Get a Rich style for this Styles object.

    +
    @@ -7925,259 +8184,315 @@

    +

    + animate -

    - animate - -

    -
    animate(
    -    attribute,
    -    value,
    +

    +
    animate(
    +    attribute,
    +    value,
         *,
    -    final_value=...,
    -    duration=None,
    -    speed=None,
    -    delay=0.0,
    -    easing=DEFAULT_EASING,
    -    on_complete=None,
    -    level="full"
    +    final_value=...,
    +    duration=None,
    +    speed=None,
    +    delay=0.0,
    +    easing=DEFAULT_EASING,
    +    on_complete=None,
    +    level="full"
     )
     
    -
    - -

    Animate an attribute.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Animate an attribute.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    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 value if not set.

    - ... -
    duration - float | None -

    The duration (in seconds) of the animation.

    - 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 -
    + - - - - + + + + - -
    level - AnimationLevel -

    Minimum level required for the animation to take place (inclusive).

    - 'full' - NameTypeDescriptionDefault
    + + + + +

    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 value if not set.

    +
    + + + ... + + + + +

    duration +

    + + float | None + + +
    +

    The duration (in seconds) of the animation.

    +
    + + + 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 + + + + +

    level +

    + + AnimationLevel + + +
    +

    Minimum level required for the animation to take place (inclusive).

    +
    + + + 'full' + + + + -
    +
    +

    + clear_rule -

    - clear_rule - -

    -
    clear_rule(rule_name)
    +
    +
    clear_rule(rule_name)
     
    -
    - -

    Clear a rule (from inline).

    +
    -
    +

    Clear a rule (from inline).

    + +
    +

    + get_rules -

    - get_rules - -

    -
    get_rules()
    +
    +
    get_rules()
     
    -
    - -

    Get rules as a dictionary

    +
    -
    +

    Get rules as a dictionary

    + +
    - -

    - has_rule +

    + has_rule -

    -
    has_rule(rule_name)
    +
    +
    has_rule(rule_name)
     
    -
    - -

    Check if a rule has been set.

    +
    -
    +

    Check if a rule has been set.

    + +
    - -

    - merge +

    + merge -

    -
    merge(other)
    +
    +
    merge(other)
     
    -
    - -

    Merge values from another Styles.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Merge values from another Styles.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    other - StylesBase -

    A Styles object.

    - required - NameTypeDescriptionDefault
    + + + + +

    other +

    + + StylesBase + + +
    +

    A Styles object.

    +
    + + + required + + + + -
    +
    - -

    - reset +

    + reset -

    -
    reset()
    +
    +
    reset()
     
    -
    - -

    Reset the rules to initial state.

    +
    -
    +

    Reset the rules to initial state.

    + +
    @@ -8185,7 +8500,7 @@

    -
    +
    @@ -8194,20 +8509,25 @@

    - UnusedParameter + UnusedParameter

    -
    +
    - -

    Helper type for a parameter that isn't specified in a method call.

    + + +

    Helper type for a parameter that isn't specified in a method call.

    -
    + + + + +
    @@ -8216,7 +8536,7 @@

    - + diff --git a/api/validation/index.html b/api/validation/index.html index bbdf21beb0..c7852b2845 100644 --- a/api/validation/index.html +++ b/api/validation/index.html @@ -5733,7 +5733,7 @@
  • - textual.validation +  validation @@ -5742,17 +5742,17 @@
  • - Failure +  Failure -
  • + +
  • + + +  WidgetError + + + +
  • + + + + + +

  • + + + + + + + + + + +
  • + + + + + textual.work + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.worker + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.worker_manager + + + + +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • + + + + + + + + + + + +
  • + + + + + + + + + +
  • + + + + + FAQ + + + + +
  • + + + + + + + + + +
  • + + + + + Roadmap + + + + +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • + + + + + + + + + + + +
  • + + + + + + + + + + + +
    +
    +
    + + +
    -
    -
    - - - -
    -
    -
    - - - + + +
  • + + +  run_action + + + - -
      - -
    • - +
    • + +
    • + - textual.widget +  scroll_down -
    • - -
    • - +
  • diff --git a/api/worker/index.html b/api/worker/index.html index c2f4207522..e93991ee9e 100644 --- a/api/worker/index.html +++ b/api/worker/index.html @@ -5817,7 +5817,7 @@
  • - textual.worker +  worker @@ -5826,7 +5826,7 @@
  • - WorkType +  WorkType @@ -5835,7 +5835,7 @@
  • - active_worker +  active_worker @@ -5844,7 +5844,7 @@
  • - DeadlockError +  DeadlockError @@ -5853,7 +5853,7 @@
  • - NoActiveWorker +  NoActiveWorker @@ -5862,17 +5862,80 @@
  • - Worker +  Worker -
  • diff --git a/api/worker_manager/index.html b/api/worker_manager/index.html index 5b837923e3..b189dab38e 100644 --- a/api/worker_manager/index.html +++ b/api/worker_manager/index.html @@ -5838,7 +5838,7 @@
  • - textual.worker_manager +  worker_manager @@ -5847,26 +5847,68 @@
  • - WorkerManager +  WorkerManager -
  • @@ -6483,7 +6579,7 @@
  • - textual.worker_manager +  worker_manager @@ -6492,26 +6588,68 @@
  • - WorkerManager +  WorkerManager -
  • @@ -6581,13 +6773,19 @@

    textual.worker_manager

    + -
    - -

    Contains WorkerManager, a class to manage workers for an app.

    +
    + +

    Contains WorkerManager, a class to manage workers for an app.

    You access this object via App.workers or Widget.workers.

    - + + + + + +
    @@ -6603,48 +6801,60 @@

    textual.worker_manager

    - WorkerManager + WorkerManager

    -
    WorkerManager(app)
    +
    WorkerManager(app)
     
    -
    +
    - -

    An object to manager a number of workers.

    + + +

    An object to manager a number of workers.

    You will not have to construct this class manually, as widgets, screens, and apps have a worker manager accessibly via a workers attribute.

    - -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    app - App -

    An App instance.

    - required - NameTypeDescriptionDefault
    + + + + +

    app +

    + + App + + +
    +

    An App instance.

    +
    + + + required + + + + + + + + + + -
    @@ -6659,286 +6869,336 @@

    -

    - add_worker + add_worker

    -
    add_worker(worker, start=True, exclusive=True)
    +
    add_worker(worker, start=True, exclusive=True)
     
    -
    - -

    Add a new worker.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Add a new worker.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    worker - Worker -

    A Worker instance.

    - required -
    start - bool -

    Start the worker if True, otherwise the worker must be started manually.

    - True -
    + - - - - + + + + - -
    exclusive - bool -

    Cancel all workers in the same group as worker.

    - True - NameTypeDescriptionDefault
    + + + + +

    worker +

    + + Worker + + +
    +

    A Worker instance.

    +
    + + + required + + + + +

    start +

    + + bool + + +
    +

    Start the worker if True, otherwise the worker must be started manually.

    +
    + + + True + + + + +

    exclusive +

    + + bool + + +
    +

    Cancel all workers in the same group as worker.

    +
    + + + True + + + + -
    +
    -

    - cancel_all + cancel_all

    -
    cancel_all()
    +
    cancel_all()
     
    -
    - -

    Cancel all workers.

    +
    -
    +

    Cancel all workers.

    + +
    -

    - cancel_group + cancel_group

    -
    cancel_group(node, group)
    +
    cancel_group(node, group)
     
    -
    - -

    Cancel a single group.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Cancel a single group.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    node - DOMNode -

    Worker DOM node.

    - required -
    + - - - - + + + + - -
    group - str -

    A group name.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    node +

    + DOMNode + +
    +

    Worker DOM node.

    +
    +
    + required +
    +

    group +

    + str + +
    +

    A group name.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[Worker] -

    A list of workers that were cancelled.

    TypeDescription
    + + + + + list[Worker] + + +
    +

    A list of workers that were cancelled.

    +
    + + + + -
    +
    -

    - cancel_node + cancel_node

    -
    cancel_node(node)
    +
    cancel_node(node)
     
    -
    - -

    Cancel all workers associated with a given node

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Cancel all workers associated with a given node

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    node - DOMNode -

    A DOM node (widget, screen, or App).

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    node +

    + DOMNode + +
    +

    A DOM node (widget, screen, or App).

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[Worker] -

    List of cancelled workers.

    TypeDescription
    + + + + + list[Worker] + + +
    +

    List of cancelled workers.

    +
    + + + + -
    +
    -

    - start_all + start_all

    -
    start_all()
    +
    start_all()
     
    -
    - -

    Start all the workers.

    +
    -
    +

    Start all the workers.

    + +
    -

    - wait_for_complete + wait_for_complete + - async

    -
    wait_for_complete(workers=None)
    +
    wait_for_complete(workers=None)
     
    -
    - -

    Wait for workers to complete.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Wait for workers to complete.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    workers - Iterable[Worker] | None -

    An iterable of workers or None to wait for all workers in the manager.

    - None - NameTypeDescriptionDefault
    + + + + +

    workers +

    + + Iterable[Worker] | None + + +
    +

    An iterable of workers or None to wait for all workers in the manager.

    +
    + + + None + + + + -
    +
    @@ -6946,7 +7206,7 @@

    Textual 0.11.0 adds a bea

    In future releases we plan on adding more Markdown extensions, and the ability to easily embed custom widgets within the document. I'm sure there are plenty of interesting applications that could be powered by dynamically generated Markdown documents.

    DataTable improvements

    There has been a lot of work on the DataTable API. We've added the ability to sort the data, which required that we introduce the concept of row and column keys. You can now reference rows / columns / cells by their coordinate or by row / column key.

    -

    Additionally there are new update_cell and update_cell_at methods to update cells after the data has been populated. Future releases will have more methods to manipulate table data, which will make it a very general purpose (and powerful) widget.

    +

    Additionally there are new update_cell and update_cell_at methods to update cells after the data has been populated. Future releases will have more methods to manipulate table data, which will make it a very general purpose (and powerful) widget.

    Tree control

    The Tree widget has grown a few methods to programmatically expand, collapse and toggle tree nodes.

    Breaking changes

    diff --git a/events/app_blur/index.html b/events/app_blur/index.html index 30bfe8e983..bf2ec272df 100644 --- a/events/app_blur/index.html +++ b/events/app_blur/index.html @@ -6451,18 +6451,21 @@

    AppBlur

    + -
    -

    - Bases: Event

    +
    +

    + Bases: Event

    - -

    Sent when the app loses focus.

    + + +

    Sent when the app loses focus.

    • Bubbles
    • Verbose
    +
    Note

    Only available when running within a terminal that supports @@ -6470,8 +6473,28 @@

    AppBlur

    + + + + + + +
    + + + + + + + + + + +
    +
    +

    See also

    +
    variant = variant
     
    -
    - -

    The variant name for the button.

    -
    +
    + +

    The variant name for the button.

    +
    @@ -7311,26 +7846,31 @@

    -

    - Pressed +

    + Pressed -

    -
    Pressed(button)
    +
    +
    Pressed(button)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Event sent when a Button is pressed.

    + + +

    Event sent when a Button is pressed.

    Can be handled using on_button_pressed in a subclass of Button or in a parent widget in the DOM.

    - + + + + +
    @@ -7344,22 +7884,22 @@

    -

    - button +

    + button + - instance-attribute -

    -
    button: Button = button
    +
    +
    button = button
     
    -
    - -

    The button that was pressed.

    -
    +
    + +

    The button that was pressed.

    +
    @@ -7367,23 +7907,23 @@

    -

    - control +

    + control + - property -

    -
    control: Button
    +
    +
    control
     
    -
    - -

    An alias for Pressed.button.

    -

    This will be the same value as Pressed.button.

    -
    +
    + +

    An alias for Pressed.button.

    +

    This will be the same value as Pressed.button.

    +
    @@ -7393,7 +7933,7 @@

    -
    +
    @@ -7401,451 +7941,576 @@

    +

    + action_press -

    - action_press - -

    -
    action_press()
    +

    +
    action_press()
     
    -
    - -

    Activate a press of the button.

    +
    -
    +

    Activate a press of the button.

    + +
    +

    + error -

    - error - classmethod -

    -
    error(
    -    label=None,
    +
    +
    error(
    +    label=None,
         *,
    -    name=None,
    -    id=None,
    -    classes=None,
    -    disabled=False
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False
     )
     
    -
    - -

    Utility constructor for creating an error Button variant.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Utility constructor for creating an error Button variant.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    label - TextType | None -

    The text that appears within the button.

    - None -
    disabled - bool -

    Whether the button is disabled or not.

    - False -
    name - str | None -

    The name of the button.

    - None -
    id - str | None -

    The ID of the button in the DOM.

    - None -
    classes - str | None -

    The CSS classes of the button.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    Whether the button is disabled or not.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    label +

    + TextType | None + +
    +

    The text that appears within the button.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the button is disabled or not.

    +
    +
    + False +
    +

    name +

    + str | None + +
    +

    The name of the button.

    +
    +
    + None +
    +

    id +

    + str | None + +
    +

    The ID of the button in the DOM.

    +
    +
    + None +
    +

    classes +

    + str | None + +
    +

    The CSS classes of the button.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the button is disabled or not.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Button -

    A Button widget of the 'error' -variant.

    TypeDescription
    + + + + + Button + + +
    +

    A Button widget of the 'error' +variant.

    +
    + + + + -
    +
    - -

    - press +

    + press -

    -
    press()
    +
    +
    press()
     
    -
    - -

    Animate the button and send the Pressed message.

    +
    + +

    Animate the button and send the Pressed message.

    Can be used to simulate the button being pressed by a user.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The button instance.

    TypeDescription
    + + + + + Self + + +
    +

    The button instance.

    +
    + + + + -
    +
    +

    + success -

    - success - classmethod -

    -
    success(
    -    label=None,
    +
    +
    success(
    +    label=None,
         *,
    -    name=None,
    -    id=None,
    -    classes=None,
    -    disabled=False
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False
     )
     
    -
    - -

    Utility constructor for creating a success Button variant.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Utility constructor for creating a success Button variant.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    label - TextType | None -

    The text that appears within the button.

    - None -
    disabled - bool -

    Whether the button is disabled or not.

    - False -
    name - str | None -

    The name of the button.

    - None -
    id - str | None -

    The ID of the button in the DOM.

    - None -
    classes - str | None -

    The CSS classes of the button.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    Whether the button is disabled or not.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    label +

    + TextType | None + +
    +

    The text that appears within the button.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the button is disabled or not.

    +
    +
    + False +
    +

    name +

    + str | None + +
    +

    The name of the button.

    +
    +
    + None +
    +

    id +

    + str | None + +
    +

    The ID of the button in the DOM.

    +
    +
    + None +
    +

    classes +

    + str | None + +
    +

    The CSS classes of the button.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the button is disabled or not.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Button -

    A Button widget of the 'success' -variant.

    TypeDescription
    + + + + + Button + + +
    +

    A Button widget of the 'success' +variant.

    +
    + + + + -
    +
    - -

    - validate_label +

    + validate_label -

    -
    validate_label(label)
    +
    +
    validate_label(label)
     
    -
    - -

    Parse markup for self.label

    +
    -
    +

    Parse markup for self.label

    + +
    +

    + warning -

    - warning - classmethod -

    -
    warning(
    -    label=None,
    +
    +
    warning(
    +    label=None,
         *,
    -    name=None,
    -    id=None,
    -    classes=None,
    -    disabled=False
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False
     )
     
    -
    - -

    Utility constructor for creating a warning Button variant.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Utility constructor for creating a warning Button variant.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    label - TextType | None -

    The text that appears within the button.

    - None -
    disabled - bool -

    Whether the button is disabled or not.

    - False -
    name - str | None -

    The name of the button.

    - None -
    id - str | None -

    The ID of the button in the DOM.

    - None -
    classes - str | None -

    The CSS classes of the button.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    Whether the button is disabled or not.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    label +

    + TextType | None + +
    +

    The text that appears within the button.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the button is disabled or not.

    +
    +
    + False +
    +

    name +

    + str | None + +
    +

    The name of the button.

    +
    +
    + None +
    +

    id +

    + str | None + +
    +

    The ID of the button in the DOM.

    +
    +
    + None +
    +

    classes +

    + str | None + +
    +

    The CSS classes of the button.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the button is disabled or not.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Button -

    A Button widget of the 'warning' -variant.

    TypeDescription
    + + + + + Button + + +
    +

    A Button widget of the 'warning' +variant.

    +
    + + + + -
    +
    @@ -7853,7 +8518,7 @@

    -
    +
    @@ -7862,14 +8527,19 @@

    - textual.widgets.button + textual.widgets.button

    -
    +
    + + + + + + -
    @@ -7884,24 +8554,24 @@

    - ButtonVariant + ButtonVariant + - module-attribute

    -
    ButtonVariant = Literal[
    +
    ButtonVariant = Literal[
         "default", "primary", "success", "warning", "error"
     ]
     
    -
    - -

    The names of the valid button variants.

    +
    + +

    The names of the valid button variants.

    These are the variants that can be used with a Button.

    -
    +
    @@ -7911,7 +8581,7 @@

    -
    +
    diff --git a/widgets/checkbox/index.html b/widgets/checkbox/index.html index 6019c9dae6..7943e3838a 100644 --- a/widgets/checkbox/index.html +++ b/widgets/checkbox/index.html @@ -4138,35 +4138,125 @@
  • - textual.widgets.Checkbox +  Checkbox
  • - + - Changed +  label -
  • + +
  • + + +  value + + + +
  • + +
  • + + +  button_first + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  tooltip + + + +
  • + +
  • + + +  Changed + + + +
  • @@ -6988,22 +7376,22 @@

    - control +

    + control + - property -

    -
    control: Checkbox
    +
    +
    control
     
    -
    - -

    An alias for Changed.checkbox.

    -
    +
    + +

    An alias for Changed.checkbox.

    +
    @@ -7013,7 +7401,7 @@

    - textual.widgets.Collapsible +  Collapsible
  • - + - Collapsed +  *children
  • - + - Expanded +  title
  • - + - Toggled +  collapsed -
  • + +
  • + + +  collapsed_symbol + + + +
  • + +
  • + + +  expanded_symbol + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  Collapsed + + + + + +
  • + +
  • + + +  Expanded + + + + + +
  • + +
  • + + +  Toggled + + + +
  • +
    Expanded(collapsible)
    +
    +
    +

    + Bases: Toggled

    -
    -

    - Bases: Toggled

    - -

    Event sent when the Collapsible widget is expanded.

    + +

    Event sent when the Collapsible widget is expanded.

    Can be handled using on_collapsible_expanded in a subclass of Collapsible or in a parent widget in the DOM.

    +

    Parameters:

    + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    +

    collapsible +

    + Collapsible + +
    +

    The Collapsible widget that was toggled.

    +
    +
    + required +
    + + + + + + + + + +
    + + + + + + + + + + +
    +
    +
    -

    - Toggled +

    + Toggled -

    -
    Toggled(collapsible)
    +
    +
    Toggled(collapsible)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Parent class subclassed by Collapsible messages.

    + + +

    Parent class subclassed by Collapsible messages.

    Can be handled with on(Collapsible.Toggled) if you want to handle expansions and collapsed in the same way, or you can handle the specific events individually.

    - -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    collapsible - Collapsible -

    The Collapsible widget that was toggled.

    - required - NameTypeDescriptionDefault
    + + + + +

    collapsible +

    + + Collapsible + + +
    +

    The Collapsible widget that was toggled.

    +
    + + + required + + + + + + + + + + -
    @@ -8011,22 +8434,22 @@

    - collapsible +

    + collapsible + - instance-attribute -

    -
    collapsible: Collapsible = collapsible
    +
    +
    collapsible = collapsible
     
    -
    - -

    The collapsible that was toggled.

    -
    +
    + +

    The collapsible that was toggled.

    +
    @@ -8034,22 +8457,22 @@

    - control +

    + control + - property -

    -
    control: Collapsible
    +
    +
    control
     
    -
    - -

    An alias for Toggled.collapsible.

    -
    +
    + +

    An alias for Toggled.collapsible.

    +
    @@ -8059,7 +8482,7 @@

    - textual.widgets.ContentSwitcher +  ContentSwitcher
  • - + - current +  *children
  • - + - visible_content +  name
  • - + - add_content() +  id
  • - + - watch_current() +  classes +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  initial + + + +
  • + +
  • + + +  current + + + +
  • + +
  • + + +  visible_content + + + +
  • + +
  • + + +  add_content + + + + + +
  • + +
  • + + +  watch_current + + + + +
  • @@ -6548,46 +6659,157 @@
  • - textual.widgets.ContentSwitcher +  ContentSwitcher + + + +
  • + +
  • + + +  *children + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled
  • - + - current +  initial
  • - + - visible_content +  current
  • - + - add_content() +  visible_content
  • - + - watch_current() +  add_content + + + + + +
  • + +
  • + + +  watch_current + + + + +
  • @@ -7154,101 +7376,146 @@

    Component Classes + -
    -

    - Bases: Container

    +
    +

    + Bases: Container

    + + + +

    A widget for switching between different children.

    - -

    A widget for switching between different children.

    Note

    All child widgets that are to be switched between need a unique ID. Children that have no ID will be hidden and ignored.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    *children - Widget -

    The widgets to switch between.

    - () -
    name - str | None -

    The name of the content switcher.

    - None -
    id - str | None -

    The ID of the content switcher in the DOM.

    - None -
    classes - str | None -

    The CSS classes of the content switcher.

    - None -
    disabled - bool -

    Whether the content switcher is disabled or not.

    - False -
    + - - - - + + + + - -
    initial - str | None -

    The ID of the initial widget to show, None or empty string for the first tab.

    - None - NameTypeDescriptionDefault
    + + + + +

    *children +

    + + Widget + + +
    +

    The widgets to switch between.

    +
    + + + () + + + + +

    name +

    + + str | None + + +
    +

    The name of the content switcher.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    The ID of the content switcher in the DOM.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    The CSS classes of the content switcher.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    Whether the content switcher is disabled or not.

    +
    + + + False + + + + +

    initial +

    + + str | None + + +
    +

    The ID of the initial widget to show, None or empty string for the first tab.

    +
    + + + None + + + + +
    Note

    If initial is not supplied no children will be shown to start with.

    - + + + + + +
    @@ -7262,31 +7529,30 @@

    Component Classes - current +

    + current + - - instance-attribute class-attribute + instance-attribute -

    -
    current: reactive[str | None] = reactive[Optional[str]](
    -    None, init=False
    -)
    +

    +
    current = reactive[Optional[str]](None, init=False)
     
    -
    - -

    The ID of the currently-displayed widget.

    +
    + +

    The ID of the currently-displayed widget.

    If set to None then no widget is visible.

    +
    Note

    If set to an unknown ID, this will result in NoMatches being raised.

    -
    +
    @@ -7294,23 +7560,23 @@

    - visible_content +

    + visible_content + - property -

    -
    visible_content: Widget | None
    +

    +
    visible_content
     
    -
    - -

    A reference to the currently-visible widget.

    +
    + +

    A reference to the currently-visible widget.

    None if nothing is visible.

    -
    +
    @@ -7319,136 +7585,171 @@

    - -

    - add_content +

    + add_content -

    -
    add_content(widget, *, id=None, set_current=False)
    +
    +
    add_content(widget, *, id=None, set_current=False)
     
    -
    - -

    Add new content to the ContentSwitcher.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Add new content to the ContentSwitcher.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    widget - Widget -

    A Widget to add.

    - required -
    id - str | None -

    ID for the widget, or None if the widget already has an ID.

    - None -
    + - - - - + + + + - -
    set_current - bool -

    Set the new widget as current (which will cause it to display).

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    widget +

    + Widget + +
    +

    A Widget to add.

    +
    +
    + required +
    +

    id +

    + str | None + +
    +

    ID for the widget, or None if the widget already has an ID.

    +
    +
    + None +
    +

    set_current +

    + bool + +
    +

    Set the new widget as current (which will cause it to display).

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - AwaitComplete -

    An awaitable to wait for the new content to be mounted.

    TypeDescription
    + + + + + AwaitComplete + + +
    +

    An awaitable to wait for the new content to be mounted.

    +
    + + + + -
    +
    - -

    - watch_current +

    + watch_current -

    -
    watch_current(old, new)
    +
    +
    watch_current(old, new)
     
    -
    - -

    React to the current visible child choice being changed.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    React to the current visible child choice being changed.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    old - str | None -

    The old widget ID (or None if there was no widget).

    - required -
    + - - - - + + + + - -
    new - str | None -

    The new widget ID (or None if nothing should be shown).

    - required - NameTypeDescriptionDefault
    + + + + +

    old +

    + + str | None + + +
    +

    The old widget ID (or None if there was no widget).

    +
    + + + required + + + + +

    new +

    + + str | None + + +
    +

    The new widget ID (or None if nothing should be shown).

    +
    + + + required + + + + -
    +
    @@ -7456,7 +7757,7 @@

    - textual.widgets.DataTable +  DataTable
  • - + - BINDINGS +  show_header
  • - + - COMPONENT_CLASSES +  show_row_labels
  • - + - cell_padding +  fixed_rows
  • - + - columns +  fixed_columns
  • - + - cursor_background_priority +  zebra_stripes
  • - + - cursor_column +  header_height
  • - + - cursor_coordinate +  show_cursor
  • - + - cursor_foreground_priority +  cursor_foreground_priority
  • - + - cursor_row +  cursor_background_priority
  • - + - cursor_type +  cursor_type
  • - + - fixed_columns +  cell_padding
  • - + - fixed_rows +  name
  • - + - header_height +  id
  • - + - hover_column +  classes
  • - + - hover_coordinate +  disabled
  • - + - hover_row +  BINDINGS
  • - + - ordered_columns +  COMPONENT_CLASSES
  • - + - ordered_rows +  cell_padding
  • - + - row_count +  columns
  • - + - rows +  cursor_background_priority
  • - + - show_cursor +  cursor_column
  • - + - show_header +  cursor_coordinate
  • - + - show_row_labels +  cursor_foreground_priority
  • - + - zebra_stripes +  cursor_row
  • - + - CellHighlighted +  cursor_type - + +
  • + + +  hover_row + +
  • - + - CellSelected +  ordered_columns - + +
  • + + +  show_row_labels + + + +
  • + +
  • + + +  zebra_stripes + +
  • - + - ColumnHighlighted +  CellHighlighted -
  • Removing columns

    -

    To remove individual columns, use remove_column. +

    To remove individual columns, use remove_column. The remove_column method accepts a key argument, which identifies the column to be removed.

    You can remove the column below the cursor using the same coordinate_to_cell_key method described above:

    # Get the keys for the row and column under the cursor.
    @@ -10363,10 +11827,10 @@ 

    Fixed dataSorting

    -

    The DataTable rows can be sorted using the sort method.

    -

    There are three methods of using sort:

    +

    The DataTable rows can be sorted using the sort method.

    +

    There are three methods of using sort:

      -
    • By Column. Pass columns in as parameters to sort by the natural order of one or more columns. Specify a column using either a ColumnKey instance or the key you supplied to add_column. For example, sort("country", "region") would sort by country, and, when the country values are equal, by region.
    • +
    • By Column. Pass columns in as parameters to sort by the natural order of one or more columns. Specify a column using either a ColumnKey instance or the key you supplied to add_column. For example, sort("country", "region") would sort by country, and, when the country values are equal, by region.
    • By Key function. Pass a function as the key parameter to sort, similar to the key function parameter of Python's sorted built-in. The function will be called once per row with a tuple of all row values.
    • By both Column and Key function. You can specify which columns to include as parameters to your key function. For example, sort("hours", "rate", key=lambda h, r: h*r) passes two values to the key function for each row.
    @@ -10631,7 +12095,7 @@

    SortingLabeled rows

    -

    A "label" can be attached to a row using the add_row method. +

    A "label" can be attached to a row using the add_row method. This will add an extra column to the left of the table which the cursor cannot interact with. This column is similar to the leftmost column in a spreadsheet containing the row numbers. The example below shows how to attach simple numbered labels to rows.

    @@ -10908,14 +12372,14 @@

    Reactive AttributesMessages

    Bindings

    The data table widget defines the following bindings:

    @@ -10925,9 +12389,11 @@

    Bindings - - + + +
    + +
    @@ -10981,7 +12447,7 @@

    BindingsComponent Classes

    The data table widget provides the following component classes:

    @@ -10991,9 +12457,11 @@

    Bindings - -

    Key(s)
    + + +
    + +
    @@ -11039,7 +12507,7 @@

    BindingsBindings - -
    -

    - Bases: ScrollView, Generic[CellType]

    - - -

    A tabular widget that contains data.

    - - -

    Parameters:

    -

    Class
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +
    +

    + Bases: ScrollView, Generic[CellType]

    + + + +

    A tabular widget that contains data.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    show_header - bool -

    Whether the table header should be visible or not.

    - True -
    show_row_labels - bool -

    Whether the row labels should be shown or not.

    - True -
    fixed_rows - int -

    The number of rows, counting from the top, that should be fixed -and still visible when the user scrolls down.

    - 0 -
    fixed_columns - int -

    The number of columns, counting from the left, that should be -fixed and still visible when the user scrolls right.

    - 0 -
    zebra_stripes - bool -

    Enables or disables a zebra effect applied to the background -color of the rows of the table, where alternate colors are styled -differently to improve the readability of the table.

    - False -
    header_height - int -

    The height, in number of cells, of the data table header.

    - 1 -
    show_cursor - bool -

    Whether the cursor should be visible when navigating the data -table or not.

    - True -
    cursor_foreground_priority - Literal['renderable', 'css'] -

    If the data associated with a cell is an -arbitrary renderable with a set foreground color, this determines whether -that color is prioritized over the cursor component class or not.

    - 'css' -
    cursor_background_priority - Literal['renderable', 'css'] -

    If the data associated with a cell is an -arbitrary renderable with a set background color, this determines whether -that color is prioritized over the cursor component class or not.

    - 'renderable' -
    cursor_type - CursorType -

    The type of cursor to be used when navigating the data table -with the keyboard.

    - 'cell' -
    cell_padding - int -

    The number of cells added on each side of each column. Setting -this value to zero will likely make your table very hard to read.

    - 1 -
    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 - NameTypeDescriptionDefault
    + + + + +

    show_header +

    + + bool + + +
    +

    Whether the table header should be visible or not.

    +
    + + + True + + + + +

    show_row_labels +

    + + bool + + +
    +

    Whether the row labels should be shown or not.

    +
    + + + True + + + + +

    fixed_rows +

    + + int + + +
    +

    The number of rows, counting from the top, that should be fixed +and still visible when the user scrolls down.

    +
    + + + 0 + + + + +

    fixed_columns +

    + + int + + +
    +

    The number of columns, counting from the left, that should be +fixed and still visible when the user scrolls right.

    +
    + + + 0 + + + + +

    zebra_stripes +

    + + bool + + +
    +

    Enables or disables a zebra effect applied to the background +color of the rows of the table, where alternate colors are styled +differently to improve the readability of the table.

    +
    + + + False + + + + +

    header_height +

    + + int + + +
    +

    The height, in number of cells, of the data table header.

    +
    + + + 1 + + + + +

    show_cursor +

    + + bool + + +
    +

    Whether the cursor should be visible when navigating the data +table or not.

    +
    + + + True + + + + +

    cursor_foreground_priority +

    + + Literal['renderable', 'css'] + + +
    +

    If the data associated with a cell is an +arbitrary renderable with a set foreground color, this determines whether +that color is prioritized over the cursor component class or not.

    +
    + + + 'css' + + + + +

    cursor_background_priority +

    + + Literal['renderable', 'css'] + + +
    +

    If the data associated with a cell is an +arbitrary renderable with a set background color, this determines whether +that color is prioritized over the cursor component class or not.

    +
    + + + 'renderable' + + + + +

    cursor_type +

    + + CursorType + + +
    +

    The type of cursor to be used when navigating the data table +with the keyboard.

    +
    + + + 'cell' + + + + +

    cell_padding +

    + + int + + +
    +

    The number of cells added on each side of each column. Setting +this value to zero will likely make your table very hard to read.

    +
    + + + 1 + + + + +

    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 + + + + + + + + + + -
    @@ -11247,43 +12812,43 @@

    Bindings - BINDINGS +

    + BINDINGS + - class-attribute -

    -
    BINDINGS: list[BindingType] = [
    -    Binding("enter", "select_cursor", "Select", show=False),
    -    Binding("up", "cursor_up", "Cursor up", show=False),
    -    Binding(
    -        "down", "cursor_down", "Cursor down", show=False
    +

    +
    BINDINGS = [
    +    Binding("enter", "select_cursor", "Select", show=False),
    +    Binding("up", "cursor_up", "Cursor up", show=False),
    +    Binding(
    +        "down", "cursor_down", "Cursor down", show=False
         ),
    -    Binding(
    -        "right", "cursor_right", "Cursor right", show=False
    +    Binding(
    +        "right", "cursor_right", "Cursor right", show=False
         ),
    -    Binding(
    -        "left", "cursor_left", "Cursor left", show=False
    +    Binding(
    +        "left", "cursor_left", "Cursor left", show=False
         ),
    -    Binding("pageup", "page_up", "Page up", show=False),
    -    Binding(
    -        "pagedown", "page_down", "Page down", show=False
    +    Binding("pageup", "page_up", "Page up", show=False),
    +    Binding(
    +        "pagedown", "page_down", "Page down", show=False
         ),
    -    Binding("ctrl+home", "scroll_top", "Top", show=False),
    -    Binding(
    -        "ctrl+end", "scroll_bottom", "Bottom", show=False
    +    Binding("ctrl+home", "scroll_top", "Top", show=False),
    +    Binding(
    +        "ctrl+end", "scroll_bottom", "Bottom", show=False
         ),
    -    Binding("home", "scroll_home", "Home", show=False),
    -    Binding("end", "scroll_end", "End", show=False),
    +    Binding("home", "scroll_home", "Home", show=False),
    +    Binding("end", "scroll_end", "End", show=False),
     ]
     
    -
    - - +
    + +
    @@ -11337,7 +12902,7 @@

    Key(s)
    -
    +
    @@ -11345,16 +12910,16 @@

    -

    - COMPONENT_CLASSES +

    + COMPONENT_CLASSES + - class-attribute -

    -
    COMPONENT_CLASSES: set[str] = {
    +
    +
    COMPONENT_CLASSES = {
         "datatable--cursor",
         "datatable--hover",
         "datatable--fixed",
    @@ -11367,9 +12932,9 @@ 

    }

    -
    - - +
    + +
    @@ -11415,7 +12980,7 @@

    - cell_padding +

    + cell_padding + - - instance-attribute class-attribute + instance-attribute -

    -
    cell_padding = cell_padding
    +
    +
    cell_padding = cell_padding
     
    -
    - -

    Horizontal padding between cells, applied on each side of each cell.

    -
    +
    + +

    Horizontal padding between cells, applied on each side of each cell.

    +
    @@ -11447,22 +13012,22 @@

    - columns +

    + columns + - instance-attribute -

    -
    columns: dict[ColumnKey, Column] = {}
    +
    +
    columns = {}
     
    -
    - -

    Metadata about the columns of the table, indexed by their key.

    -
    +
    + +

    Metadata about the columns of the table, indexed by their key.

    +
    @@ -11470,23 +13035,23 @@

    -

    - cursor_background_priority +

    + cursor_background_priority + - instance-attribute -

    -
    cursor_background_priority = cursor_background_priority
    +
    +
    cursor_background_priority = cursor_background_priority
     
    -
    - -

    Should we prioritize the cursor component class CSS background or the renderable background +

    + +

    Should we prioritize the cursor component class CSS background or the renderable background in the event where a cell contains a renderable with a background color.

    -
    +
    @@ -11494,22 +13059,22 @@

    - cursor_column +

    + cursor_column + - property -

    -
    cursor_column: int
    +
    +
    cursor_column
     
    -
    - -

    The index of the column that the DataTable cursor is currently on.

    -
    +
    + +

    The index of the column that the DataTable cursor is currently on.

    +
    @@ -11517,27 +13082,27 @@

    - cursor_coordinate +

    + cursor_coordinate + - - instance-attribute class-attribute + instance-attribute -

    -
    cursor_coordinate: Reactive[Coordinate] = Reactive(
    -    Coordinate(0, 0), repaint=False, always_update=True
    +
    +
    cursor_coordinate = Reactive(
    +    Coordinate(0, 0), repaint=False, always_update=True
     )
     
    -
    - -

    Current cursor Coordinate.

    +
    + +

    Current cursor Coordinate.

    This can be set programmatically or changed via the method -move_cursor.

    -
    +move_cursor.

    +
    @@ -11545,23 +13110,23 @@

    - cursor_foreground_priority +

    + cursor_foreground_priority + - instance-attribute -

    -
    cursor_foreground_priority = cursor_foreground_priority
    +
    +
    cursor_foreground_priority = cursor_foreground_priority
     
    -
    - -

    Should we prioritize the cursor component class CSS foreground or the renderable foreground +

    + +

    Should we prioritize the cursor component class CSS foreground or the renderable foreground in the event where a cell contains a renderable with a foreground color.

    -
    +
    @@ -11569,22 +13134,22 @@

    - cursor_row +

    + cursor_row + - property -

    -
    cursor_row: int
    +
    +
    cursor_row
     
    -
    - -

    The index of the row that the DataTable cursor is currently on.

    -
    +
    + +

    The index of the row that the DataTable cursor is currently on.

    +
    @@ -11592,23 +13157,23 @@

    - cursor_type +

    + cursor_type + - - instance-attribute class-attribute + instance-attribute -

    -
    cursor_type: Reactive[CursorType] = cursor_type
    +
    +
    cursor_type = cursor_type
     
    -
    - -

    The type of cursor of the DataTable.

    -
    +
    + +

    The type of cursor of the DataTable.

    +
    @@ -11616,23 +13181,23 @@

    - fixed_columns +

    + fixed_columns + - - instance-attribute class-attribute + instance-attribute -

    -
    fixed_columns = fixed_columns
    +
    +
    fixed_columns = fixed_columns
     
    -
    - -

    The number of columns to fix (prevented from scrolling).

    -
    +
    + +

    The number of columns to fix (prevented from scrolling).

    +
    @@ -11640,23 +13205,23 @@

    - fixed_rows +

    + fixed_rows + - - instance-attribute class-attribute + instance-attribute -

    -
    fixed_rows = fixed_rows
    +
    +
    fixed_rows = fixed_rows
     
    -
    - -

    The number of rows to fix (prevented from scrolling).

    -
    +
    + +

    The number of rows to fix (prevented from scrolling).

    +
    @@ -11664,23 +13229,23 @@

    - header_height +

    + header_height + - - instance-attribute class-attribute + instance-attribute -

    -
    header_height = header_height
    +
    +
    header_height = header_height
     
    -
    - -

    The height of the header row (the row of column labels).

    -
    +
    + +

    The height of the header row (the row of column labels).

    +
    @@ -11688,22 +13253,22 @@

    - hover_column +

    + hover_column + - property -

    -
    hover_column: int
    +
    +
    hover_column
     
    -
    - -

    The index of the column that the mouse cursor is currently hovering above.

    -
    +
    + +

    The index of the column that the mouse cursor is currently hovering above.

    +
    @@ -11711,25 +13276,25 @@

    - hover_coordinate +

    + hover_coordinate + - - instance-attribute class-attribute + instance-attribute -

    -
    hover_coordinate: Reactive[Coordinate] = Reactive(
    -    Coordinate(0, 0), repaint=False, always_update=True
    +
    +
    hover_coordinate = Reactive(
    +    Coordinate(0, 0), repaint=False, always_update=True
     )
     
    -
    - -

    The coordinate of the DataTable that is being hovered.

    -
    +
    + +

    The coordinate of the DataTable that is being hovered.

    +
    @@ -11737,22 +13302,22 @@

    - hover_row +

    + hover_row + - property -

    -
    hover_row: int
    +
    +
    hover_row
     
    -
    - -

    The index of the row that the mouse cursor is currently hovering above.

    -
    +
    + +

    The index of the row that the mouse cursor is currently hovering above.

    +
    @@ -11760,22 +13325,22 @@

    - ordered_columns +

    + ordered_columns + - property -

    -
    ordered_columns: list[Column]
    +
    +
    ordered_columns
     
    -
    - -

    The list of Columns in the DataTable, ordered as they appear on screen.

    -
    +
    + +

    The list of Columns in the DataTable, ordered as they appear on screen.

    +
    @@ -11783,22 +13348,22 @@

    - ordered_rows +

    + ordered_rows + - property -

    -
    ordered_rows: list[Row]
    +
    +
    ordered_rows
     
    -
    - -

    The list of Rows in the DataTable, ordered as they appear on screen.

    -
    +
    + +

    The list of Rows in the DataTable, ordered as they appear on screen.

    +
    @@ -11806,22 +13371,22 @@

    - row_count +

    + row_count + - property -

    -
    row_count: int
    +
    +
    row_count
     
    -
    - -

    The number of rows currently present in the DataTable.

    -
    +
    + +

    The number of rows currently present in the DataTable.

    +
    @@ -11829,22 +13394,22 @@

    - rows +

    + rows + - instance-attribute -

    -
    rows: dict[RowKey, Row] = {}
    +
    +
    rows = {}
     
    -
    - -

    Metadata about the rows of the table, indexed by their key.

    -
    +
    + +

    Metadata about the rows of the table, indexed by their key.

    +
    @@ -11852,23 +13417,23 @@

    -

    - show_cursor +

    + show_cursor + - - instance-attribute class-attribute + instance-attribute -

    -
    show_cursor = show_cursor
    +
    +
    show_cursor = show_cursor
     
    -
    - -

    Show/hide both the keyboard and hover cursor.

    -
    +
    + +

    Show/hide both the keyboard and hover cursor.

    +
    @@ -11876,23 +13441,23 @@

    - show_header +

    + show_header + - - instance-attribute class-attribute + instance-attribute -

    -
    show_header = show_header
    +
    +
    show_header = show_header
     
    -
    - -

    Show/hide the header row (the row of column labels).

    -
    +
    + +

    Show/hide the header row (the row of column labels).

    +
    @@ -11900,23 +13465,23 @@

    - show_row_labels +

    + show_row_labels + - - instance-attribute class-attribute + instance-attribute -

    -
    show_row_labels = show_row_labels
    +
    +
    show_row_labels = show_row_labels
     
    -
    - -

    Show/hide the column containing the labels of rows.

    -
    +
    + +

    Show/hide the column containing the labels of rows.

    +
    @@ -11924,24 +13489,24 @@

    - zebra_stripes +

    + zebra_stripes + - - instance-attribute class-attribute + instance-attribute -

    -
    zebra_stripes = zebra_stripes
    +
    +
    zebra_stripes = zebra_stripes
     
    -
    - -

    Apply alternating styles, datatable--even-row and datatable-odd-row, to create a zebra effect, e.g., +

    + +

    Apply alternating styles, datatable--even-row and datatable-odd-row, to create a zebra effect, e.g., alternating light and dark backgrounds.

    -
    +
    @@ -11950,20 +13515,21 @@

    - CellHighlighted +

    + CellHighlighted -

    -
    CellHighlighted(data_table, value, coordinate, cell_key)
    +
    +
    CellHighlighted(data_table, value, coordinate, cell_key)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when the cursor moves to highlight a new cell.

    + + +

    Posted when the cursor moves to highlight a new cell.

    This is only relevant when the cursor_type is "cell". It's also posted when the cell cursor is re-enabled (by setting show_cursor=True), and when the cursor type is @@ -11972,7 +13538,11 @@

    @@ -11986,22 +13556,22 @@

    - cell_key +

    + cell_key + - instance-attribute -

    -
    cell_key: CellKey = cell_key
    +
    +
    cell_key = cell_key
     
    -
    - -

    The key for the highlighted cell.

    -
    +
    + +

    The key for the highlighted cell.

    +
    @@ -12009,22 +13579,22 @@

    - control +

    + control + - property -

    -
    control: DataTable
    +
    +
    control
     
    -
    - -

    Alias for the data table.

    -
    +
    + +

    Alias for the data table.

    +
    @@ -12032,22 +13602,22 @@

    - coordinate +

    + coordinate + - instance-attribute -

    -
    coordinate: Coordinate = coordinate
    +
    +
    coordinate = coordinate
     
    -
    - -

    The coordinate of the highlighted cell.

    -
    +
    + +

    The coordinate of the highlighted cell.

    +
    @@ -12055,22 +13625,22 @@

    - data_table +

    + data_table + - instance-attribute -

    -
    data_table = data_table
    +
    +
    data_table = data_table
     
    -
    - -

    The data table.

    -
    +
    + +

    The data table.

    +
    @@ -12078,22 +13648,22 @@

    - value +

    + value + - instance-attribute -

    -
    value: CellType = value
    +
    +
    value = value
     
    -
    - -

    The value in the highlighted cell.

    -
    +
    + +

    The value in the highlighted cell.

    +
    @@ -12103,7 +13673,7 @@

    - CellSelected +

    + CellSelected -

    -
    CellSelected(data_table, value, coordinate, cell_key)
    +
    +
    CellSelected(data_table, value, coordinate, cell_key)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted by the DataTable widget when a cell is selected.

    + + +

    Posted by the DataTable widget when a cell is selected.

    This is only relevant when the cursor_type is "cell". Can be handled using on_data_table_cell_selected in a subclass of DataTable or in a parent widget in the DOM.

    - + + + + +
    @@ -12145,22 +13720,22 @@

    - cell_key +

    + cell_key + - instance-attribute -

    -
    cell_key: CellKey = cell_key
    +
    +
    cell_key = cell_key
     
    -
    - -

    The key for the selected cell.

    -
    +
    + +

    The key for the selected cell.

    +
    @@ -12168,22 +13743,22 @@

    - control +

    + control + - property -

    -
    control: DataTable
    +
    +
    control
     
    -
    - -

    Alias for the data table.

    -
    +
    + +

    Alias for the data table.

    +
    @@ -12191,22 +13766,22 @@

    - coordinate +

    + coordinate + - instance-attribute -

    -
    coordinate: Coordinate = coordinate
    +
    +
    coordinate = coordinate
     
    -
    - -

    The coordinate of the cell that was selected.

    -
    +
    + +

    The coordinate of the cell that was selected.

    +
    @@ -12214,22 +13789,22 @@

    - data_table +

    + data_table + - instance-attribute -

    -
    data_table = data_table
    +
    +
    data_table = data_table
     
    -
    - -

    The data table.

    -
    +
    + +

    The data table.

    +
    @@ -12237,22 +13812,22 @@

    - value +

    + value + - instance-attribute -

    -
    value: CellType = value
    +
    +
    value = value
     
    -
    - -

    The value in the cell that was selected.

    -
    +
    + +

    The value in the cell that was selected.

    +
    @@ -12262,7 +13837,7 @@

    - ColumnHighlighted +

    + ColumnHighlighted -

    -
    ColumnHighlighted(data_table, cursor_column, column_key)
    +
    +
    ColumnHighlighted(data_table, cursor_column, column_key)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when a column is highlighted.

    + + +

    Posted when a column is highlighted.

    This message is only posted when the cursor_type is set to "column". Can be handled using on_data_table_column_highlighted in a subclass of DataTable or in a parent @@ -12291,7 +13867,11 @@

    @@ -12305,22 +13885,22 @@

    - column_key +

    + column_key + - instance-attribute -

    -
    column_key = column_key
    +
    +
    column_key = column_key
     
    -
    - -

    The key of the column that was highlighted.

    -
    +
    + +

    The key of the column that was highlighted.

    +
    @@ -12328,22 +13908,22 @@

    - control +

    + control + - property -

    -
    control: DataTable
    +
    +
    control
     
    -
    - -

    Alias for the data table.

    -
    +
    + +

    Alias for the data table.

    +
    @@ -12351,22 +13931,22 @@

    - cursor_column +

    + cursor_column + - instance-attribute -

    -
    cursor_column: int = cursor_column
    +
    +
    cursor_column = cursor_column
     
    -
    - -

    The x-coordinate of the column that was highlighted.

    -
    +
    + +

    The x-coordinate of the column that was highlighted.

    +
    @@ -12374,22 +13954,22 @@

    - data_table +

    + data_table + - instance-attribute -

    -
    data_table = data_table
    +
    +
    data_table = data_table
     
    -
    - -

    The data table.

    -
    +
    + +

    The data table.

    +
    @@ -12399,7 +13979,7 @@

    -

    +
    @@ -12407,20 +13987,21 @@

    - ColumnSelected +

    + ColumnSelected -

    -
    ColumnSelected(data_table, cursor_column, column_key)
    +
    +
    ColumnSelected(data_table, cursor_column, column_key)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when a column is selected.

    + + +

    Posted when a column is selected.

    This message is only posted when the cursor_type is set to "column". Can be handled using on_data_table_column_selected in a subclass of DataTable or in a parent @@ -12428,7 +14009,11 @@

    @@ -12442,22 +14027,22 @@

    - column_key +

    + column_key + - instance-attribute -

    -
    column_key = column_key
    +
    +
    column_key = column_key
     
    -
    - -

    The key of the column that was selected.

    -
    +
    + +

    The key of the column that was selected.

    +
    @@ -12465,22 +14050,22 @@

    - control +

    + control + - property -

    -
    control: DataTable
    +
    +
    control
     
    -
    - -

    Alias for the data table.

    -
    +
    + +

    Alias for the data table.

    +
    @@ -12488,22 +14073,22 @@

    - cursor_column +

    + cursor_column + - instance-attribute -

    -
    cursor_column: int = cursor_column
    +
    +
    cursor_column = cursor_column
     
    -
    - -

    The x-coordinate of the column that was selected.

    -
    +
    + +

    The x-coordinate of the column that was selected.

    +
    @@ -12511,22 +14096,22 @@

    - data_table +

    + data_table + - instance-attribute -

    -
    data_table = data_table
    +
    +
    data_table = data_table
     
    -
    - -

    The data table.

    -
    +
    + +

    The data table.

    +
    @@ -12536,7 +14121,7 @@

    - HeaderSelected +

    + HeaderSelected -

    -
    HeaderSelected(data_table, column_key, column_index, label)
    +
    +
    HeaderSelected(data_table, column_key, column_index, label)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    + + + +

    Posted when a column header/label is clicked.

    + + + + - -

    Posted when a column header/label is clicked.

    -
    @@ -12575,22 +14165,22 @@

    - column_index +

    + column_index + - instance-attribute -

    -
    column_index = column_index
    +
    +
    column_index = column_index
     
    -
    - -

    The index for the column.

    -
    +
    + +

    The index for the column.

    +
    @@ -12598,22 +14188,22 @@

    - column_key +

    + column_key + - instance-attribute -

    -
    column_key = column_key
    +
    +
    column_key = column_key
     
    -
    - -

    The key for the column.

    -
    +
    + +

    The key for the column.

    +
    @@ -12621,22 +14211,22 @@

    - control +

    + control + - property -

    -
    control: DataTable
    +
    +
    control
     
    -
    - -

    Alias for the data table.

    -
    +
    + +

    Alias for the data table.

    +
    @@ -12644,22 +14234,22 @@

    - data_table +

    + data_table + - instance-attribute -

    -
    data_table = data_table
    +
    +
    data_table = data_table
     
    -
    - -

    The data table.

    -
    +
    + +

    The data table.

    +
    @@ -12667,22 +14257,22 @@

    - label +

    + label + - instance-attribute -

    -
    label = label
    +
    +
    label = label
     
    -
    - -

    The text of the label.

    -
    +
    + +

    The text of the label.

    +
    @@ -12692,7 +14282,7 @@

    - RowHighlighted +

    + RowHighlighted -

    -
    RowHighlighted(data_table, cursor_row, row_key)
    +
    +
    RowHighlighted(data_table, cursor_row, row_key)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when a row is highlighted.

    + + +

    Posted when a row is highlighted.

    This message is only posted when the cursor_type is set to "row". Can be handled using on_data_table_row_highlighted in a subclass of DataTable or in a parent @@ -12721,7 +14312,11 @@

    @@ -12735,22 +14330,22 @@

    - control +

    + control + - property -

    -
    control: DataTable
    +
    +
    control
     
    -
    - -

    Alias for the data table.

    -
    +
    + +

    Alias for the data table.

    +
    @@ -12758,22 +14353,22 @@

    - cursor_row +

    + cursor_row + - instance-attribute -

    -
    cursor_row: int = cursor_row
    +
    +
    cursor_row = cursor_row
     
    -
    - -

    The y-coordinate of the cursor that highlighted the row.

    -
    +
    + +

    The y-coordinate of the cursor that highlighted the row.

    +
    @@ -12781,22 +14376,22 @@

    - data_table +

    + data_table + - instance-attribute -

    -
    data_table = data_table
    +
    +
    data_table = data_table
     
    -
    - -

    The data table.

    -
    +
    + +

    The data table.

    +
    @@ -12804,22 +14399,22 @@

    - row_key +

    + row_key + - instance-attribute -

    -
    row_key: RowKey = row_key
    +
    +
    row_key = row_key
     
    -
    - -

    The key of the row that was highlighted.

    -
    +
    + +

    The key of the row that was highlighted.

    +
    @@ -12829,7 +14424,7 @@

    - RowLabelSelected +

    + RowLabelSelected -

    -
    RowLabelSelected(data_table, row_key, row_index, label)
    +
    +
    RowLabelSelected(data_table, row_key, row_index, label)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    + + + +

    Posted when a row label is clicked.

    + + + + - -

    Posted when a row label is clicked.

    -
    @@ -12868,22 +14468,22 @@

    - control +

    + control + - property -

    -
    control: DataTable
    +
    +
    control
     
    -
    - -

    Alias for the data table.

    -
    +
    + +

    Alias for the data table.

    +
    @@ -12891,22 +14491,22 @@

    - data_table +

    + data_table + - instance-attribute -

    -
    data_table = data_table
    +
    +
    data_table = data_table
     
    -
    - -

    The data table.

    -
    +
    + +

    The data table.

    +
    @@ -12914,22 +14514,22 @@

    - label +

    + label + - instance-attribute -

    -
    label = label
    +
    +
    label = label
     
    -
    - -

    The text of the label.

    -
    +
    + +

    The text of the label.

    +
    @@ -12937,22 +14537,22 @@

    - row_index +

    + row_index + - instance-attribute -

    -
    row_index = row_index
    +
    +
    row_index = row_index
     
    -
    - -

    The index for the column.

    -
    +
    + +

    The index for the column.

    +
    @@ -12960,22 +14560,22 @@

    - row_key +

    + row_key + - instance-attribute -

    -
    row_key = row_key
    +
    +
    row_key = row_key
     
    -
    - -

    The key for the column.

    -
    +
    + +

    The key for the column.

    +
    @@ -12985,7 +14585,7 @@

    - RowSelected +

    + RowSelected -

    -
    RowSelected(data_table, cursor_row, row_key)
    +
    +
    RowSelected(data_table, cursor_row, row_key)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when a row is selected.

    + + +

    Posted when a row is selected.

    This message is only posted when the cursor_type is set to "row". Can be handled using on_data_table_row_selected in a subclass of DataTable or in a parent @@ -13014,7 +14615,11 @@

    @@ -13028,22 +14633,22 @@

    - control +

    + control + - property -

    -
    control: DataTable
    +
    +
    control
     
    -
    - -

    Alias for the data table.

    -
    +
    + +

    Alias for the data table.

    +
    @@ -13051,22 +14656,22 @@

    - cursor_row +

    + cursor_row + - instance-attribute -

    -
    cursor_row: int = cursor_row
    +
    +
    cursor_row = cursor_row
     
    -
    - -

    The y-coordinate of the cursor that made the selection.

    -
    +
    + +

    The y-coordinate of the cursor that made the selection.

    +
    @@ -13074,22 +14679,22 @@

    - data_table +

    + data_table + - instance-attribute -

    -
    data_table = data_table
    +
    +
    data_table = data_table
     
    -
    - -

    The data table.

    -
    +
    + +

    The data table.

    +
    @@ -13097,22 +14702,22 @@

    - row_key +

    + row_key + - instance-attribute -

    -
    row_key: RowKey = row_key
    +
    +
    row_key = row_key
     
    -
    - -

    The key of the row that was selected.

    -
    +
    + +

    The key of the row that was selected.

    +
    @@ -13122,7 +14727,7 @@

    +

    + action_page_down -

    - action_page_down - -

    -
    action_page_down()
    +
    +
    action_page_down()
     
    -
    - -

    Move the cursor one page down.

    +
    -
    +

    Move the cursor one page down.

    + +
    - -

    - action_page_left +

    + action_page_left -

    -
    action_page_left()
    +
    +
    action_page_left()
     
    -
    - -

    Move the cursor one page left.

    +
    -
    +

    Move the cursor one page left.

    + +
    +

    + action_page_right -

    - action_page_right - -

    -
    action_page_right()
    +
    +
    action_page_right()
     
    -
    - -

    Move the cursor one page right.

    +
    -
    +

    Move the cursor one page right.

    + +
    - -

    - action_page_up +

    + action_page_up -

    -
    action_page_up()
    +
    +
    action_page_up()
     
    -
    - -

    Move the cursor one page up.

    +
    -
    +

    Move the cursor one page up.

    + +
    +

    + action_scroll_bottom -

    - action_scroll_bottom - -

    -
    action_scroll_bottom()
    +
    +
    action_scroll_bottom()
     
    -
    - -

    Move the cursor and scroll to the bottom.

    +
    -
    +

    Move the cursor and scroll to the bottom.

    + +
    - -

    - action_scroll_end +

    + action_scroll_end -

    -
    action_scroll_end()
    +
    +
    action_scroll_end()
     
    -
    - -

    Move the cursor and scroll to the rightmost column.

    +
    -
    +

    Move the cursor and scroll to the rightmost column.

    + +
    +

    + action_scroll_home -

    - action_scroll_home - -

    -
    action_scroll_home()
    +
    +
    action_scroll_home()
     
    -
    - -

    Move the cursor and scroll to the leftmost column.

    +
    -
    +

    Move the cursor and scroll to the leftmost column.

    + +
    - -

    - action_scroll_top +

    + action_scroll_top -

    -
    action_scroll_top()
    +
    +
    action_scroll_top()
     
    -
    - -

    Move the cursor and scroll to the top.

    +
    -
    +

    Move the cursor and scroll to the top.

    + +
    +

    + add_column -

    - add_column - -

    -
    add_column(label, *, width=None, key=None, default=None)
    +
    +
    add_column(label, *, width=None, key=None, default=None)
     
    -
    - -

    Add a column to the table.

    - -

    Parameters:

    -
    Class
    - - - - - - - - - - - - - - - - - - - - - +
    + +

    Add a column to the table.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    label - TextType -

    A str or Text object containing the label (shown top of column).

    - required -
    width - int | None -

    Width of the column in cells or None to fit content.

    - None -
    + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    key - str | None -

    A key which uniquely identifies this column. -If None, it will be generated for you.

    - None - NameTypeDescriptionDefault
    +

    label +

    + TextType + +
    +

    A str or Text object containing the label (shown top of column).

    +
    +
    + required +
    +

    width +

    + int | None + +
    +

    Width of the column in cells or None to fit content.

    +
    +
    + None +
    +

    key +

    + str | None + +
    +

    A key which uniquely identifies this column. +If None, it will be generated for you.

    +
    +
    + None +
    +

    default +

    + CellType | None + +
    +

    The value to insert into pre-existing rows.

    +
    +
    + None +
    + + +

    Returns:

    + + - - - - + + - -
    default - CellType | None -

    The value to insert into pre-existing rows.

    - None - TypeDescription
    - -

    Returns:

    - - - - - - - - - - - + + + - - -
    TypeDescription
    - ColumnKey -

    Uniquely identifies this column. Can be used to retrieve this column + +

    + ColumnKey + +
    +

    Uniquely identifies this column. Can be used to retrieve this column regardless of its current location in the DataTable (it could have moved -after being added due to sorting/insertion/deletion of other columns).

    +after being added due to sorting/insertion/deletion of other columns).

    +
    + + + + -
    +
    - -

    - add_columns +

    + add_columns -

    -
    add_columns(*labels)
    +
    +
    add_columns(*labels)
     
    -
    - -

    Add a number of columns.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Add a number of columns.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    *labels - TextType -

    Column headers.

    - () - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    *labels +

    + TextType + +
    +

    Column headers.

    +
    +
    + () +
    + + +

    Returns:

    + + - - + + - -
    - list[ColumnKey] -

    A list of the keys for the columns that were added. See -the add_column method docstring for more information on how -these keys are used.

    TypeDescription
    + + + + + list[ColumnKey] + + +
    +

    A list of the keys for the columns that were added. See +the add_column method docstring for more information on how +these keys are used.

    +
    + + + + -
    +
    - -

    - add_row +

    + add_row -

    -
    add_row(*cells, height=1, key=None, label=None)
    +
    +
    add_row(*cells, height=1, key=None, label=None)
     
    -
    - -

    Add a row at the bottom of the DataTable.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Add a row at the bottom of the DataTable.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    *cells - CellType -

    Positional arguments should contain cell data.

    - () -
    height - int | None -

    The height of a row (in lines). Use None to auto-detect the optimal -height.

    - 1 -
    + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    key - str | None -

    A key which uniquely identifies this row. If None, it will be generated -for you and returned.

    - None - NameTypeDescriptionDefault
    +

    *cells +

    + CellType + +
    +

    Positional arguments should contain cell data.

    +
    +
    + () +
    +

    height +

    + int | None + +
    +

    The height of a row (in lines). Use None to auto-detect the optimal +height.

    +
    +
    + 1 +
    +

    key +

    + str | None + +
    +

    A key which uniquely identifies this row. If None, it will be generated +for you and returned.

    +
    +
    + None +
    +

    label +

    + TextType | None + +
    +

    The label for the row. Will be displayed to the left if supplied.

    +
    +
    + None +
    + + +

    Returns:

    + + - - - - + + - -
    label - TextType | None -

    The label for the row. Will be displayed to the left if supplied.

    - None - TypeDescription
    - -

    Returns:

    - - - - - - - - - - - + + + - - -
    TypeDescription
    - RowKey -

    Unique identifier for this row. Can be used to retrieve this row regardless + +

    + RowKey + +
    +

    Unique identifier for this row. Can be used to retrieve this row regardless of its current location in the DataTable (it could have moved after -being added due to sorting or insertion/deletion of other rows).

    +being added due to sorting or insertion/deletion of other rows).

    +
    + + + + -
    +
    +

    + add_rows -

    - add_rows - -

    -
    add_rows(rows)
    +
    +
    add_rows(rows)
     
    -
    - -

    Add a number of rows at the bottom of the DataTable.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Add a number of rows at the bottom of the DataTable.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    rows - Iterable[Iterable[CellType]] -

    Iterable of rows. A row is an iterable of cells.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    rows +

    + Iterable[Iterable[CellType]] + +
    +

    Iterable of rows. A row is an iterable of cells.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[RowKey] -

    A list of the keys for the rows that were added. See -the add_row method docstring for more information on how -these keys are used.

    TypeDescription
    + + + + + list[RowKey] + + +
    +

    A list of the keys for the rows that were added. See +the add_row method docstring for more information on how +these keys are used.

    +
    + + + + -
    +
    +

    + clear -

    - clear - -

    -
    clear(columns=False)
    +
    +
    clear(columns=False)
     
    -
    - -

    Clear the table.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Clear the table.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    columns - bool -

    Also clear the columns.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    columns +

    + bool + +
    +

    Also clear the columns.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The DataTable instance.

    TypeDescription
    + + + + + Self + + +
    +

    The DataTable instance.

    +
    + + + + -
    +
    +

    + coordinate_to_cell_key -

    - coordinate_to_cell_key - -

    -
    coordinate_to_cell_key(coordinate)
    +
    +
    coordinate_to_cell_key(coordinate)
     
    -
    - -

    Return the key for the cell currently occupying this coordinate.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Return the key for the cell currently occupying this coordinate.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    coordinate - Coordinate -

    The coordinate to exam the current cell key of.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    coordinate +

    + Coordinate + +
    +

    The coordinate to exam the current cell key of.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - CellKey -

    The key of the cell currently occupying this coordinate.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + CellKey + +
    +

    The key of the cell currently occupying this coordinate.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - CellDoesNotExist -

    If the coordinate is not valid.

    TypeDescription
    + + + + + CellDoesNotExist + + +
    +

    If the coordinate is not valid.

    +
    + + + + -
    +
    - -

    - get_cell +

    + get_cell -

    -
    get_cell(row_key, column_key)
    +
    +
    get_cell(row_key, column_key)
     
    -
    - -

    Given a row key and column key, return the value of the corresponding cell.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Given a row key and column key, return the value of the corresponding cell.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    row_key - RowKey | str -

    The row key of the cell.

    - required -
    + - - - - + + + + - -
    column_key - ColumnKey | str -

    The column key of the cell.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    row_key +

    + RowKey | str + +
    +

    The row key of the cell.

    +
    +
    + required +
    +

    column_key +

    + ColumnKey | str + +
    +

    The column key of the cell.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - CellType -

    The value of the cell identified by the row and column keys.

    TypeDescription
    + + + + + CellType + + +
    +

    The value of the cell identified by the row and column keys.

    +
    + + + + -
    +
    +

    + get_cell_at -

    - get_cell_at - -

    -
    get_cell_at(coordinate)
    +
    +
    get_cell_at(coordinate)
     
    -
    - -

    Get the value from the cell occupying the given coordinate.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the value from the cell occupying the given coordinate.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    coordinate - Coordinate -

    The coordinate to retrieve the value from.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    coordinate +

    + Coordinate + +
    +

    The coordinate to retrieve the value from.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - CellType -

    The value of the cell at the coordinate.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + CellType + +
    +

    The value of the cell at the coordinate.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - CellDoesNotExist -

    If there is no cell with the given coordinate.

    TypeDescription
    + + + + + CellDoesNotExist + + +
    +

    If there is no cell with the given coordinate.

    +
    + + + + -
    +
    - -

    - get_cell_coordinate +

    + get_cell_coordinate -

    -
    get_cell_coordinate(row_key, column_key)
    +
    +
    get_cell_coordinate(row_key, column_key)
     
    -
    - -

    Given a row key and column key, return the corresponding cell coordinate.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Given a row key and column key, return the corresponding cell coordinate.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    row_key - RowKey | str -

    The row key of the cell.

    - required -
    + - - - - + + + + - -
    column_key - ColumnKey | str -

    The column key of the cell.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    row_key +

    + RowKey | str + +
    +

    The row key of the cell.

    +
    +
    + required +
    +

    column_key +

    + ColumnKey | str + +
    +

    The column key of the cell.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Coordinate -

    The current coordinate of the cell identified by the row and column keys.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Coordinate + +
    +

    The current coordinate of the cell identified by the row and column keys.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - CellDoesNotExist -

    If the specified cell does not exist.

    TypeDescription
    + + + + + CellDoesNotExist + + +
    +

    If the specified cell does not exist.

    +
    + + + + -
    +
    - -

    - get_column +

    + get_column -

    -
    get_column(column_key)
    +
    +
    get_column(column_key)
     
    -
    - -

    Get the values from the column identified by the given column key.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the values from the column identified by the given column key.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    column_key - ColumnKey | str -

    The key of the column.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    column_key +

    + ColumnKey | str + +
    +

    The key of the column.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Iterable[CellType] -

    A generator which yields the cells in the column.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Iterable[CellType] + +
    +

    A generator which yields the cells in the column.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - ColumnDoesNotExist -

    If there is no column corresponding to the key.

    TypeDescription
    + + + + + ColumnDoesNotExist + + +
    +

    If there is no column corresponding to the key.

    +
    + + + + -
    +
    +

    + get_column_at -

    - get_column_at - -

    -
    get_column_at(column_index)
    +
    +
    get_column_at(column_index)
     
    -
    - -

    Get the values from the column at a given index.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the values from the column at a given index.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    column_index - int -

    The index of the column.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    column_index +

    + int + +
    +

    The index of the column.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Iterable[CellType] -

    A generator which yields the cells in the column.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Iterable[CellType] + +
    +

    A generator which yields the cells in the column.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - ColumnDoesNotExist -

    If there is no column with the given index.

    TypeDescription
    + + + + + ColumnDoesNotExist + + +
    +

    If there is no column with the given index.

    +
    + + + + -
    +
    - -

    - get_column_index +

    + get_column_index -

    -
    get_column_index(column_key)
    +
    +
    get_column_index(column_key)
     
    -
    - -

    Return the current index for the column identified by column_key.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Return the current index for the column identified by column_key.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    column_key - ColumnKey | str -

    The column key to find the current index of.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    column_key +

    + ColumnKey | str + +
    +

    The column key to find the current index of.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - int -

    The current index of the specified column key.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + int + +
    +

    The current index of the specified column key.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - ColumnDoesNotExist -

    If the column key does not exist.

    TypeDescription
    + + + + + ColumnDoesNotExist + + +
    +

    If the column key does not exist.

    +
    + + + + -
    +
    +

    + get_row -

    - get_row - -

    -
    get_row(row_key)
    +
    +
    get_row(row_key)
     
    -
    - -

    Get the values from the row identified by the given row key.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the values from the row identified by the given row key.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    row_key - RowKey | str -

    The key of the row.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    row_key +

    + RowKey | str + +
    +

    The key of the row.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[CellType] -

    A list of the values contained within the row.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + list[CellType] + +
    +

    A list of the values contained within the row.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - RowDoesNotExist -

    When there is no row corresponding to the key.

    TypeDescription
    + + + + + RowDoesNotExist + + +
    +

    When there is no row corresponding to the key.

    +
    + + + + -
    +
    - -

    - get_row_at +

    + get_row_at -

    -
    get_row_at(row_index)
    +
    +
    get_row_at(row_index)
     
    -
    - -

    Get the values from the cells in a row at a given index. This will +

    + +

    Get the values from the cells in a row at a given index. This will return the values from a row based on the rows current position in the table.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    row_index - int -

    The index of the row.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    row_index +

    + int + +
    +

    The index of the row.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - list[CellType] -

    A list of the values contained in the row.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + list[CellType] + +
    +

    A list of the values contained in the row.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - RowDoesNotExist -

    If there is no row with the given index.

    TypeDescription
    + + + + + RowDoesNotExist + + +
    +

    If there is no row with the given index.

    +
    + + + + -
    +
    +

    + get_row_height -

    - get_row_height - -

    -
    get_row_height(row_key)
    +
    +
    get_row_height(row_key)
     
    -
    - -

    Given a row key, return the height of that row in terminal cells.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Given a row key, return the height of that row in terminal cells.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    row_key - RowKey -

    The key of the row.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    row_key +

    + RowKey + +
    +

    The key of the row.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - int -

    The height of the row, measured in terminal character cells.

    TypeDescription
    + + + + + int + + +
    +

    The height of the row, measured in terminal character cells.

    +
    + + + + -
    +
    +

    + get_row_index -

    - get_row_index - -

    -
    get_row_index(row_key)
    +
    +
    get_row_index(row_key)
     
    -
    - -

    Return the current index for the row identified by row_key.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Return the current index for the row identified by row_key.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    row_key - RowKey | str -

    The row key to find the current index of.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    row_key +

    + RowKey | str + +
    +

    The row key to find the current index of.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - int -

    The current index of the specified row key.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + int + +
    +

    The current index of the specified row key.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - RowDoesNotExist -

    If the row key does not exist.

    TypeDescription
    + + + + + RowDoesNotExist + + +
    +

    If the row key does not exist.

    +
    + + + + -
    +
    - -

    - is_valid_column_index +

    + is_valid_column_index -

    -
    is_valid_column_index(column_index)
    +
    +
    is_valid_column_index(column_index)
     
    -
    - -

    Return a boolean indicating whether the column_index is within table bounds.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Return a boolean indicating whether the column_index is within table bounds.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    column_index - int -

    The column index to check.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    column_index +

    + int + +
    +

    The column index to check.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the column index is within the bounds of the table.

    TypeDescription
    + + + + + bool + + +
    +

    True if the column index is within the bounds of the table.

    +
    + + + + -
    +
    - -

    - is_valid_coordinate +

    + is_valid_coordinate -

    -
    is_valid_coordinate(coordinate)
    +
    +
    is_valid_coordinate(coordinate)
     
    -
    - -

    Return a boolean indicating whether the given coordinate is valid.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Return a boolean indicating whether the given coordinate is valid.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    coordinate - Coordinate -

    The coordinate to validate.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    coordinate +

    + Coordinate + +
    +

    The coordinate to validate.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the coordinate is within the bounds of the table.

    TypeDescription
    + + + + + bool + + +
    +

    True if the coordinate is within the bounds of the table.

    +
    + + + + -
    +
    - -

    - is_valid_row_index +

    + is_valid_row_index -

    -
    is_valid_row_index(row_index)
    +
    +
    is_valid_row_index(row_index)
     
    -
    - -

    Return a boolean indicating whether the row_index is within table bounds.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Return a boolean indicating whether the row_index is within table bounds.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    row_index - int -

    The row index to check.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    row_index +

    + int + +
    +

    The row index to check.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the row index is within the bounds of the table.

    TypeDescription
    + + + + + bool + + +
    +

    True if the row index is within the bounds of the table.

    +
    + + + + -
    +
    - -

    - move_cursor +

    + move_cursor -

    -
    move_cursor(
    -    *, row=None, column=None, animate=False, scroll=True
    +
    +
    move_cursor(
    +    *, row=None, column=None, animate=False, scroll=True
     )
     
    -
    - -

    Move the cursor to the given position.

    +
    + +

    Move the cursor to the given position.

    +
    Example @@ -14747,617 +16646,767 @@

    # datatable.cursor_coordinate == Coordinate(3, 6)

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    row - int | None -

    The new row to move the cursor to.

    - None -
    column - int | None -

    The new column to move the cursor to.

    - None -
    animate - bool -

    Whether to animate the change of coordinates.

    - False -
    + - - - - + + + + - -
    scroll - bool -

    Scroll the cursor into view after moving.

    - True - NameTypeDescriptionDefault
    + + + + +

    row +

    + + int | None + + +
    +

    The new row to move the cursor to.

    +
    + + + None + + + + +

    column +

    + + int | None + + +
    +

    The new column to move the cursor to.

    +
    + + + None + + + + +

    animate +

    + + bool + + +
    +

    Whether to animate the change of coordinates.

    +
    + + + False + + + + +

    scroll +

    + + bool + + +
    +

    Scroll the cursor into view after moving.

    +
    + + + True + + + + -
    +
    +

    + refresh_column + + +

    +
    refresh_column(column_index)
    +
    -

    - refresh_column +
    +

    Refresh the column at the given index.

    -

    -
    refresh_column(column_index)
    -
    -
    - -

    Refresh the column at the given index.

    - -

    Parameters:

    - - - - - - - - - - +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    column_index - int -

    The index of the column to refresh.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    column_index +

    + int + +
    +

    The index of the column to refresh.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The DataTable instance.

    TypeDescription
    + + + + + Self + + +
    +

    The DataTable instance.

    +
    + + + + -
    +
    +

    + refresh_coordinate -

    - refresh_coordinate - -

    -
    refresh_coordinate(coordinate)
    +
    +
    refresh_coordinate(coordinate)
     
    -
    - -

    Refresh the cell at a coordinate.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Refresh the cell at a coordinate.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    coordinate - Coordinate -

    The coordinate to refresh.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    coordinate +

    + Coordinate + +
    +

    The coordinate to refresh.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The DataTable instance.

    TypeDescription
    + + + + + Self + + +
    +

    The DataTable instance.

    +
    + + + + -
    +
    +

    + refresh_row -

    - refresh_row - -

    -
    refresh_row(row_index)
    +
    +
    refresh_row(row_index)
     
    -
    - -

    Refresh the row at the given index.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Refresh the row at the given index.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    row_index - int -

    The index of the row to refresh.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    row_index +

    + int + +
    +

    The index of the row to refresh.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The DataTable instance.

    TypeDescription
    + + + + + Self + + +
    +

    The DataTable instance.

    +
    + + + + -
    +
    +

    + remove_column -

    - remove_column - -

    -
    remove_column(column_key)
    +
    +
    remove_column(column_key)
     
    -
    - -

    Remove a column (identified by a key) from the DataTable.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Remove a column (identified by a key) from the DataTable.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    column_key - ColumnKey | str -

    The key identifying the column to remove.

    - required - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    column_key +

    + ColumnKey | str + +
    +

    The key identifying the column to remove.

    +
    +
    + required +
    + + +

    Raises:

    + + - - + + - -
    - ColumnDoesNotExist -

    If the column key does not exist.

    TypeDescription
    + + + + + ColumnDoesNotExist + + +
    +

    If the column key does not exist.

    +
    + + + + -
    +
    +

    + remove_row -

    - remove_row - -

    -
    remove_row(row_key)
    +
    +
    remove_row(row_key)
     
    -
    - -

    Remove a row (identified by a key) from the DataTable.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Remove a row (identified by a key) from the DataTable.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    row_key - RowKey | str -

    The key identifying the row to remove.

    - required - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    row_key +

    + RowKey | str + +
    +

    The key identifying the row to remove.

    +
    +
    + required +
    + + +

    Raises:

    + + - - + + - -
    - RowDoesNotExist -

    If the row key does not exist.

    TypeDescription
    + + + + + RowDoesNotExist + + +
    +

    If the row key does not exist.

    +
    + + + + -
    +
    +

    + sort -

    - sort - -

    -
    sort(*columns, key=None, reverse=False)
    +
    +
    sort(*columns, key=None, reverse=False)
     
    -
    - -

    Sort the rows in the DataTable by one or more column keys or a +

    + +

    Sort the rows in the DataTable by one or more column keys or a key function (or other callable). If both columns and a key function are specified, only data from those columns will sent to the key function.

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    columns - ColumnKey | str -

    One or more columns to sort by the values in.

    - () -
    key - Callable[[Any], Any] | None -

    A function (or other callable) that returns a key to -use for sorting purposes.

    - None -
    + - - - - + + + + - -
    reverse - bool -

    If True, the sort order will be reversed.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    columns +

    + ColumnKey | str + +
    +

    One or more columns to sort by the values in.

    +
    +
    + () +
    +

    key +

    + Callable[[Any], Any] | None + +
    +

    A function (or other callable) that returns a key to +use for sorting purposes.

    +
    +
    + None +
    +

    reverse +

    + bool + +
    +

    If True, the sort order will be reversed.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The DataTable instance.

    TypeDescription
    + + + + + Self + + +
    +

    The DataTable instance.

    +
    + + + + -
    +
    +

    + update_cell -

    - update_cell - -

    -
    update_cell(
    -    row_key, column_key, value, *, update_width=False
    +
    +
    update_cell(
    +    row_key, column_key, value, *, update_width=False
     )
     
    -
    - -

    Update the cell identified by the specified row key and column key.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Update the cell identified by the specified row key and column key.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    row_key - RowKey | str -

    The key identifying the row.

    - required -
    column_key - ColumnKey | str -

    The key identifying the column.

    - required -
    value - CellType -

    The new value to put inside the cell.

    - required -
    + - - - - + + + + - -
    update_width - bool -

    Whether to resize the column width to accommodate -for the new cell content.

    - False - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    row_key +

    + RowKey | str + +
    +

    The key identifying the row.

    +
    +
    + required +
    +

    column_key +

    + ColumnKey | str + +
    +

    The key identifying the column.

    +
    +
    + required +
    +

    value +

    + CellType + +
    +

    The new value to put inside the cell.

    +
    +
    + required +
    +

    update_width +

    + bool + +
    +

    Whether to resize the column width to accommodate +for the new cell content.

    +
    +
    + False +
    + + +

    Raises:

    + + - - + + - -
    - CellDoesNotExist -

    When the supplied row_key and column_key -cannot be found in the table.

    TypeDescription
    + + + + + CellDoesNotExist + + +
    +

    When the supplied row_key and column_key +cannot be found in the table.

    +
    + + + + -
    +
    - -

    - update_cell_at +

    + update_cell_at -

    -
    update_cell_at(coordinate, value, *, update_width=False)
    +
    +
    update_cell_at(coordinate, value, *, update_width=False)
     
    -
    - -

    Update the content inside the cell currently occupying the given coordinate.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Update the content inside the cell currently occupying the given coordinate.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    coordinate - Coordinate -

    The coordinate to update the cell at.

    - required -
    value - CellType -

    The new value to place inside the cell.

    - required -
    + - - - - + + + + - -
    update_width - bool -

    Whether to resize the column width to accommodate -for the new cell content.

    - False - NameTypeDescriptionDefault
    + + + + +

    coordinate +

    + + Coordinate + + +
    +

    The coordinate to update the cell at.

    +
    + + + required + + + + +

    value +

    + + CellType + + +
    +

    The new value to place inside the cell.

    +
    + + + required + + + + +

    update_width +

    + + bool + + +
    +

    Whether to resize the column width to accommodate +for the new cell content.

    +
    + + + False + + + + -
    +
    @@ -15365,7 +17414,7 @@

    - textual.widgets.data_table + textual.widgets.data_table

    -
    +
    + + + + + + -
    @@ -15396,21 +17450,21 @@

    - CellType + CellType + - module-attribute

    -
    CellType = TypeVar('CellType')
    +
    CellType = TypeVar('CellType')
     
    -
    - -

    Type used for cells in the DataTable.

    -
    +
    + +

    Type used for cells in the DataTable.

    +
    @@ -15419,21 +17473,21 @@

    - CursorType + CursorType + - module-attribute

    -
    CursorType = Literal['cell', 'row', 'column', 'none']
    +
    CursorType = Literal['cell', 'row', 'column', 'none']
     
    -
    - -

    The valid types of cursors for DataTable.cursor_type.

    -
    +
    + +

    The valid types of cursors for DataTable.cursor_type.

    +
    @@ -15443,24 +17497,29 @@

    - CellDoesNotExist + CellDoesNotExist

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    The cell key/index was invalid.

    + + +

    The cell key/index was invalid.

    Raised when the coordinates or cell key provided does not exist in the DataTable (e.g. out of bounds index, invalid key)

    -
    + + + + +
    @@ -15469,18 +17528,19 @@

    - CellKey + CellKey

    -
    -

    - Bases: NamedTuple

    +
    +

    + Bases: NamedTuple

    - -

    A unique identifier for a cell in the DataTable.

    + + +

    A unique identifier for a cell in the DataTable.

    A cell key is a (row_key, column_key) tuple.

    Even if the cell changes visual location (i.e. moves to a different coordinate in the table), this key @@ -15488,7 +17548,11 @@

    - + + + + +
    @@ -15502,22 +17566,22 @@

    -

    - column_key +

    + column_key + - instance-attribute -

    -
    column_key: ColumnKey
    +

    +
    column_key
     
    -
    - -

    The key of this cell's column.

    -
    +
    + +

    The key of this cell's column.

    +
    @@ -15525,22 +17589,22 @@

    -

    - row_key +

    + row_key + - instance-attribute -

    -
    row_key: RowKey
    +
    +
    row_key
     
    -
    - -

    The key of this cell's row.

    -
    +
    + +

    The key of this cell's row.

    +
    @@ -15550,7 +17614,7 @@

    -
    +
    @@ -15559,24 +17623,32 @@

    - Column + Column + - dataclass

    +
    Column(
    +    key, label, width=0, content_width=0, auto_width=False
    +)
    +
    + +
    + + + +

    Metadata for a column in the DataTable.

    + + -
    - -

    Metadata for a column in the DataTable.

    -
    @@ -15591,62 +17663,73 @@

    - -

    - get_render_width +

    + get_render_width -

    -
    get_render_width(data_table)
    +

    +
    get_render_width(data_table)
     
    -
    - -

    Width, in cells, required to render the column with padding included.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Width, in cells, required to render the column with padding included.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    data_table - DataTable[Any] -

    The data table where the column will be rendered.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +
    data_table +
    + DataTable[Any] + +
    +

    The data table where the column will be rendered.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - int -

    The width, in cells, required to render the column with padding included.

    TypeDescription
    + + + + + int + + +
    +

    The width, in cells, required to render the column with padding included.

    +
    + + + + -
    +
    @@ -15654,7 +17737,7 @@

    - ColumnDoesNotExist + ColumnDoesNotExist

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Raised when the column index or column key provided does not exist + + +

    Raised when the column index or column key provided does not exist in the DataTable (e.g. out of bounds index, invalid key)

    -
    + + + + +
    @@ -15688,26 +17776,48 @@

    - ColumnKey + ColumnKey

    +
    ColumnKey(value=None)
    +
    +
    +

    + Bases: StringKey

    -
    -

    - Bases: StringKey

    - -

    Uniquely identifies a column in the DataTable.

    + +

    Uniquely identifies a column in the DataTable.

    Even if the visual location of the column changes due to sorting or other modifications, a key will always refer to the same column.

    + + + + + + +
    + + + + + + + + + + +
    +
    +
    @@ -15715,24 +17825,29 @@

    - DuplicateKey + DuplicateKey

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    The key supplied already exists.

    + + +

    The key supplied already exists.

    Raised when the RowKey or ColumnKey provided already refers to an existing row or column in the DataTable. Keys must be unique.

    -
    + + + + +
    @@ -15741,24 +17856,30 @@

    - Row + Row + - dataclass

    +
    Row(key, height, label=None, auto_height=False)
    +
    + +
    + + + +

    Metadata for a row in the DataTable.

    + + -
    - -

    Metadata for a row in the DataTable.

    -
    @@ -15774,7 +17895,7 @@

    -
    +
    @@ -15783,23 +17904,28 @@

    - RowDoesNotExist + RowDoesNotExist

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Raised when the row index or row key provided does not exist + + +

    Raised when the row index or row key provided does not exist in the DataTable (e.g. out of bounds index, invalid key)

    -
    + + + + +
    @@ -15808,26 +17934,48 @@

    - RowKey + RowKey

    +
    RowKey(value=None)
    +
    +
    +

    + Bases: StringKey

    -
    -

    - Bases: StringKey

    - -

    Uniquely identifies a row in the DataTable.

    + +

    Uniquely identifies a row in the DataTable.

    Even if the visual location of the row changes due to sorting or other modifications, a key will always refer to the same row.

    + + + + + + +
    + + + + + + + + + + +
    +
    +
    @@ -15835,24 +17983,29 @@

    - StringKey + StringKey

    -
    StringKey(value=None)
    +
    StringKey(value=None)
     
    -
    +
    - -

    An object used as a key in a mapping.

    + + +

    An object used as a key in a mapping.

    It can optionally wrap a string, and lookups into a map using the object behave the same as lookups using the string itself.

    - + + + + +
    @@ -15868,7 +18021,7 @@

    -
    +
    @@ -15877,7 +18030,7 @@

    - + diff --git a/widgets/digits/index.html b/widgets/digits/index.html index 1ee02c1ba4..368763b7d0 100644 --- a/widgets/digits/index.html +++ b/widgets/digits/index.html @@ -4222,28 +4222,88 @@
  • - textual.widgets.Digits +  Digits
  • - + - value +  value
  • - + - update() +  name +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  value + + + +
  • + +
  • + + +  update + + + + +
  • @@ -6530,28 +6590,88 @@
  • - textual.widgets.Digits +  Digits + + + +
  • + +
  • + + +  value + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id
  • - + - value +  classes
  • - + - update() +  disabled +
  • + +
  • + + +  value + + + +
  • + +
  • + + +  update + + + + +
  • @@ -6579,7 +6699,7 @@

    Digitsupdate() to change the text after the widget has been mounted.

    +

    You can set the text to be displayed in the constructor, or call update() to change the text after the widget has been mounted.

    This widget will respect the text-align rule.

    @@ -6797,131 +6917,131 @@

    Example + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - ClockApp + ClockApp - + - - - - - - - - - - - -╶╮ ╷ ╷   ╶╮ ╭─╴   ╶─╮╶─╮ - │ ╰─┤ :  │ ├─╮ :  ─┤┌─┘ -╶┴╴  ╵   ╶┴╴╰─╯   ╶─╯╰─╴ - - - - - - - - - - + + + + + + + + + + + +╶╮ ╷ ╷   ╷ ╷╭─╴   ╶─╮╶─┐ + │ ╰─┤ : ╰─┤╰─╮ : ┌─┘  │ +╶┴╴  ╵     ╵╶─╯   ╰─╴  ╵ + + + + + + + + + + @@ -6978,82 +7098,119 @@

    Component Classes + -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    A widget to display numerical values using a 3x3 grid of unicode characters.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

    A widget to display numerical values using a 3x3 grid of unicode characters.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    value - str -

    Value to display in widget.

    - '' -
    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 of the widget.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    Whether the widget is disabled or not.

    - False - NameTypeDescriptionDefault
    + + + + +

    value +

    + + str + + +
    +

    Value to display in widget.

    +
    + + + '' + + + + +

    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 of the widget.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    Whether the widget is disabled or not.

    +
    + + + False + + + + + + + + + + -
    @@ -7067,22 +7224,22 @@

    Component Classes - value +

    + value + - property -

    -
    value: str
    +

    +
    value
     
    -
    - -

    The current value displayed in the Digits.

    -
    +
    + +

    The current value displayed in the Digits.

    +
    @@ -7091,62 +7248,73 @@

    +

    + update -

    - update - -

    -
    update(value)
    +

    +
    update(value)
     
    -
    - -

    Update the Digits with a new value.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Update the Digits with a new value.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    value - str -

    New value to display.

    - required - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    value +

    + str + +
    +

    New value to display.

    +
    +
    + required +
    + + +

    Raises:

    + + - - + + - -
    - ValueError -

    If the value isn't a str.

    TypeDescription
    + + + + + ValueError + + +
    +

    If the value isn't a str.

    +
    + + + + -
    +
    @@ -7154,7 +7322,7 @@

    - + diff --git a/widgets/directory_tree/index.html b/widgets/directory_tree/index.html index e8ed9e0479..d4f388442a 100644 --- a/widgets/directory_tree/index.html +++ b/widgets/directory_tree/index.html @@ -4261,80 +4261,143 @@
  • - textual.widgets.DirectoryTree +  DirectoryTree
  • - + - COMPONENT_CLASSES +  path
  • - + - ICON_FILE +  name
  • - + - PATH +  id
  • - + - path +  classes
  • - + - DirectorySelected +  disabled -
  • + +
  • + + +  COMPONENT_CLASSES + + + +
  • + +
  • + + +  ICON_FILE + + + +
  • + +
  • + + +  PATH + + + +
  • + +
  • + + +  path + + + +
  • + +
  • + + +  DirectorySelected + + + +
  • +
    control
     
    -
    - -

    The Tree that had a directory selected.

    -
    +
    + +

    The Tree that had a directory selected.

    +
    @@ -7585,22 +8057,22 @@

    - node +

    + node + - instance-attribute -

    -
    node: TreeNode[DirEntry] = node
    +

    +
    node = node
     
    -
    - -

    The tree node of the directory that was selected.

    -
    +
    + +

    The tree node of the directory that was selected.

    +
    @@ -7608,22 +8080,22 @@

    - path +

    + path + - instance-attribute -

    -
    path: Path = path
    +

    +
    path = path
     
    -
    - -

    The path of the directory that was selected.

    -
    +
    + +

    The path of the directory that was selected.

    +
    @@ -7633,7 +8105,7 @@

    - + @@ -7641,61 +8113,79 @@

    - FileSelected +

    + FileSelected -

    -
    FileSelected(node, path)
    +
    +
    FileSelected(node, path)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when a file is selected.

    + + +

    Posted when a file is selected.

    Can be handled using on_directory_tree_file_selected in a subclass of DirectoryTree or in a parent widget in the DOM.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    node - TreeNode[DirEntry] -

    The tree node for the file that was selected.

    - required -
    + - - - - + + + + - -
    path - Path -

    The path of the file that was selected.

    - required - NameTypeDescriptionDefault
    + + + + +

    node +

    + + TreeNode[DirEntry] + + +
    +

    The tree node for the file that was selected.

    +
    + + + required + + + + +

    path +

    + + Path + + +
    +

    The path of the file that was selected.

    +
    + + + required + + + + + + + + + + -
    @@ -7709,22 +8199,22 @@

    - control +

    + control + - property -

    -
    control: Tree[DirEntry]
    +
    +
    control
     
    -
    - -

    The Tree that had a file selected.

    -
    +
    + +

    The Tree that had a file selected.

    +
    @@ -7732,22 +8222,22 @@

    - node +

    + node + - instance-attribute -

    -
    node: TreeNode[DirEntry] = node
    +
    +
    node = node
     
    -
    - -

    The tree node of the file that was selected.

    -
    +
    + +

    The tree node of the file that was selected.

    +
    @@ -7755,22 +8245,22 @@

    - path +

    + path + - instance-attribute -

    -
    path: Path = path
    +
    +
    path = path
     
    -
    - -

    The path of the file that was selected.

    -
    +
    + +

    The path of the file that was selected.

    +
    @@ -7780,7 +8270,7 @@

    +

    + clear_node -

    - clear_node - -

    -
    clear_node(node)
    +
    +
    clear_node(node)
     
    -
    - -

    Clear all nodes under the given node.

    +
    + +

    Clear all nodes under the given node.

    + -

    Returns:

    - - - - - - - - +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The Tree instance.

    TypeDescription
    + + + + + Self + + +
    +

    The Tree instance.

    +
    + + + + -
    +
    +

    + filter_paths -

    - filter_paths - -

    -
    filter_paths(paths)
    +
    +
    filter_paths(paths)
     
    -
    - -

    Filter the paths before adding them to the tree.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Filter the paths before adding them to the tree.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    paths - Iterable[Path] -

    The paths to be filtered.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    paths +

    + Iterable[Path] + +
    +

    The paths to be filtered.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Iterable[Path] -

    The filtered paths.

    TypeDescription
    -

    By default this method returns all of the paths provided. To create + + + + + Iterable[Path] + + +

    +

    The filtered paths.

    +
    + + + + +

    By default this method returns all of the paths provided. To create a filtered DirectoryTree inherit from it and implement your own version of this method.

    -
    +
    - -

    - process_label +

    + process_label -

    -
    process_label(label)
    +
    +
    process_label(label)
     
    -
    - -

    Process a str or Text into a label. May be overridden in a subclass to modify how labels are rendered.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Process a str or Text into a label. May be overridden in a subclass to modify how labels are rendered.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    label - TextType -

    Label.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    label +

    + TextType + +
    +

    Label.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Text -

    A Rich Text object.

    TypeDescription
    + + + + + Text + + +
    +

    A Rich Text object.

    +
    + + + + -
    +
    - -

    - reload +

    + reload -

    -
    reload()
    +
    +
    reload()
     
    -
    - -

    Reload the DirectoryTree contents.

    +
    + +

    Reload the DirectoryTree contents.

    + -

    Returns:

    - - - - - - - - +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - AwaitComplete -

    An optionally awaitable that ensures the tree has finished reloading.

    TypeDescription
    + + + + + AwaitComplete + + +
    +

    An optionally awaitable that ensures the tree has finished reloading.

    +
    + + + + -
    +
    - -

    - reload_node +

    + reload_node -

    -
    reload_node(node)
    +
    +
    reload_node(node)
     
    -
    - -

    Reload the given node's contents.

    +
    + +

    Reload the given node's contents.

    The return value may be awaited to ensure the DirectoryTree has reached a stable state and is no longer performing any node reloading (of this node or any other nodes).

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    node - TreeNode[DirEntry] -

    The root of the subtree to reload.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    node +

    + TreeNode[DirEntry] + +
    +

    The root of the subtree to reload.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - AwaitComplete -

    An optionally awaitable that ensures the subtree has finished reloading.

    TypeDescription
    + + + + + AwaitComplete + + +
    +

    An optionally awaitable that ensures the subtree has finished reloading.

    +
    + + + + -
    +
    - -

    - render_label +

    + render_label -

    -
    render_label(node, base_style, style)
    +
    +
    render_label(node, base_style, style)
     
    -
    - -

    Render a label for the given node.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Render a label for the given node.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    node - TreeNode[DirEntry] -

    A tree node.

    - required -
    base_style - Style -

    The base style of the widget.

    - required -
    + - - - - + + + + - -
    style - Style -

    The additional style for the label.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    node +

    + TreeNode[DirEntry] + +
    +

    A tree node.

    +
    +
    + required +
    +

    base_style +

    + Style + +
    +

    The base style of the widget.

    +
    +
    + required +
    +

    style +

    + Style + +
    +

    The additional style for the label.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Text -

    A Rich Text object containing the label.

    TypeDescription
    + + + + + Text + + +
    +

    A Rich Text object containing the label.

    +
    + + + + -
    +
    - -

    - reset_node +

    + reset_node -

    -
    reset_node(node, label, data=None)
    +
    +
    reset_node(node, label, data=None)
     
    -
    - -

    Clear the subtree and reset the given node.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Clear the subtree and reset the given node.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    node - TreeNode[DirEntry] -

    The node to reset.

    - required -
    label - TextType -

    The label for the node.

    - required -
    + - - - - + + + + - -
    data - DirEntry | None -

    Optional data for the node.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    node +

    + TreeNode[DirEntry] + +
    +

    The node to reset.

    +
    +
    + required +
    +

    label +

    + TextType + +
    +

    The label for the node.

    +
    +
    + required +
    +

    data +

    + DirEntry | None + +
    +

    Optional data for the node.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The Tree instance.

    TypeDescription
    + + + + + Self + + +
    +

    The Tree instance.

    +
    + + + + -
    +
    +

    + validate_path -

    - validate_path - -

    -
    validate_path(path)
    +
    +
    validate_path(path)
     
    -
    - -

    Ensure that the path is of the Path type.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Ensure that the path is of the Path type.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    path - str | Path -

    The path to validate.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    path +

    + str | Path + +
    +

    The path to validate.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Path -

    The validated Path value.

    TypeDescription
    + + + + + Path + + +
    +

    The validated Path value.

    +
    + + + + +
    Note

    The result will always be a Python Path object, regardless of the value given.

    -
    +
    +

    + watch_path -

    - watch_path - async -

    -
    watch_path()
    +
    +
    watch_path()
     
    -
    - -

    Watch for changes to the path of the directory tree.

    +
    + +

    Watch for changes to the path of the directory tree.

    If the path is changed the directory tree will be repopulated using the new value as the root.

    -
    +
    @@ -8314,7 +8902,7 @@

    - textual.widgets.Footer +  Footer
  • - + - compact +  *children
  • - + - show_command_palette +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  show_command_palette + + + +
  • + +
  • + + +  compact + + + +
  • + +
  • + + +  show_command_palette @@ -6548,25 +6602,79 @@
  • - textual.widgets.Footer +  Footer + + + +
  • + +
  • + + +  *children
  • - + - compact +  name
  • - + - show_command_palette +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  show_command_palette + + + +
  • + +
  • + + +  compact + + + +
  • + +
  • + + +  show_command_palette @@ -6834,90 +6942,133 @@

    Additional Notes + -
    -

    - Bases: ScrollableContainer

    +
    +

    + Bases: ScrollableContainer

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    *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 -
    + - - - - + + + + - -
    show_command_palette - bool -

    Show key binding to command palette, on the right of the footer.

    - True - NameTypeDescriptionDefault
    + + + + +

    *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 + + + + +

    show_command_palette +

    + + bool + + +
    +

    Show key binding to command palette, on the right of the footer.

    +
    + + + True + + + + + + + + + + -
    @@ -6931,23 +7082,23 @@

    Additional Notes - compact +

    + compact + - - instance-attribute class-attribute + instance-attribute -

    -
    compact = reactive(False)
    +

    +
    compact = reactive(False)
     
    -
    - -

    Display in compact style.

    -
    +
    + +

    Display in compact style.

    +
    @@ -6955,23 +7106,23 @@

    -

    - show_command_palette +

    + show_command_palette + - - instance-attribute class-attribute + instance-attribute -

    -
    show_command_palette = reactive(True)
    +

    +
    show_command_palette = reactive(True)
     
    -
    - -

    Show the key to invoke the command palette.

    -
    +
    + +

    Show the key to invoke the command palette.

    +
  • @@ -6981,7 +7132,7 @@

    - textual.widgets.Header +  Header
  • - + - icon +  show_clock
  • - + - screen_sub_title +  name
  • - + - screen_title +  id
  • - + - tall +  classes
  • - + - time_format +  icon + + + +
  • + +
  • + + +  time_format + + + +
  • + +
  • + + +  icon + + + +
  • + +
  • + + +  screen_sub_title + + + +
  • + +
  • + + +  screen_title + + + +
  • + +
  • + + +  tall + + + +
  • + +
  • + + +  time_format @@ -6557,52 +6611,106 @@
  • - textual.widgets.Header +  Header + + + +
  • + +
  • + + +  show_clock + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id
  • - + - icon +  classes
  • - + - screen_sub_title +  icon
  • - + - screen_title +  time_format
  • - + - tall +  icon
  • - + - time_format +  screen_sub_title + + + +
  • + +
  • + + +  screen_title + + + +
  • + +
  • + + +  tall + + + +
  • + +
  • + + +  time_format @@ -7021,92 +7129,135 @@

    Component Classes + -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    A header widget with icon and clock.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

    A header widget with icon and clock.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    show_clock - bool -

    True if the clock should be shown on the right of the header.

    - False -
    name - str | None -

    The name of the header widget.

    - None -
    id - str | None -

    The ID of the header widget in the DOM.

    - None -
    classes - str | None -

    The CSS classes of the header widget.

    - None -
    icon - str | None -

    Single character to use as an icon, or None for default.

    - None -
    + - - - - + + + + - -
    time_format - str | None -

    Time format (used by strftime) for clock, or None for default.

    - None - NameTypeDescriptionDefault
    + + + + +

    show_clock +

    + + bool + + +
    +

    True if the clock should be shown on the right of the header.

    +
    + + + False + + + + +

    name +

    + + str | None + + +
    +

    The name of the header widget.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    The ID of the header widget in the DOM.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    The CSS classes of the header widget.

    +
    + + + None + + + + +

    icon +

    + + str | None + + +
    +

    Single character to use as an icon, or None for default.

    +
    + + + None + + + + +

    time_format +

    + + str | None + + +
    +

    Time format (used by strftime) for clock, or None for default.

    +
    + + + None + + + + + + + + + + -
    @@ -7120,23 +7271,23 @@

    Component Classes - icon +

    + icon + - - instance-attribute class-attribute + instance-attribute -

    -
    icon: Reactive[str] = Reactive('⭘')
    +

    +
    icon = Reactive('⭘')
     
    -
    - -

    A character for the icon at the top left.

    -
    +
    + +

    A character for the icon at the top left.

    +
    @@ -7144,23 +7295,23 @@

    -

    - screen_sub_title +

    + screen_sub_title + - property -

    -
    screen_sub_title: str
    +

    +
    screen_sub_title
     
    -
    - -

    The sub-title that this header will display.

    +
    + +

    The sub-title that this header will display.

    This depends on Screen.sub_title and App.sub_title.

    -
    +
  • @@ -7168,23 +7319,23 @@

    - screen_title +

    + screen_title + - property -

    -
    screen_title: str
    +
    +
    screen_title
     
    -
    - -

    The title that this header will display.

    +
    + +

    The title that this header will display.

    This depends on Screen.title and App.title.

    -
    +
    @@ -7192,23 +7343,23 @@

    -

    - tall +

    + tall + - - instance-attribute class-attribute + instance-attribute -

    -
    tall: Reactive[bool] = Reactive(False)
    +
    +
    tall = Reactive(False)
     
    -
    - -

    Set to True for a taller header or False for a single line header.

    -
    +
    + +

    Set to True for a taller header or False for a single line header.

    +
    @@ -7216,23 +7367,23 @@

    -

    - time_format +

    + time_format + - - instance-attribute class-attribute + instance-attribute -

    -
    time_format: Reactive[str] = Reactive('%X')
    +
    +
    time_format = Reactive('%X')
     
    -
    - -

    Time format of the clock.

    -
    +
    + +

    Time format of the clock.

    +
    @@ -7242,7 +7393,7 @@

    -
    +
    diff --git a/widgets/input/index.html b/widgets/input/index.html index ce3a86bf50..82044a8ed9 100644 --- a/widgets/input/index.html +++ b/widgets/input/index.html @@ -4383,152 +4383,296 @@
  • - textual.widgets.Input +  Input
  • - + - BINDINGS +  value
  • - + - COMPONENT_CLASSES +  placeholder
  • - + - cursor_screen_offset +  highlighter
  • - + - cursor_width +  password
  • - + - is_valid +  restrict
  • - + - max_length +  type
  • - + - restrict +  max_length
  • - + - suggester +  suggester
  • - + - type +  validators
  • - + - valid_empty +  validate_on
  • - + - validate_on +  valid_empty
  • - + - Changed +  name -
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  tooltip + + + +
  • + +
  • + + +  BINDINGS + + + +
  • + +
  • + + +  COMPONENT_CLASSES + + + +
  • + +
  • + + +  cursor_screen_offset + + + +
  • + +
  • + + +  cursor_width + + + +
  • + +
  • + + +  is_valid + + + +
  • + +
  • + + +  max_length + + + +
  • + +
  • + + +  restrict + + + +
  • + +
  • + + +  suggester + + + +
  • + +
  • + + +  type + + + +
  • + +
  • + + +  valid_empty + + + +
  • + +
  • + + +  validate_on + + + +
  • + +
  • + + +  Changed + + + +
  • @@ -7818,13 +8184,13 @@

    Validating Inputvalidators to the Input widget to validate the value.

    All the supplied validators will run when the value changes, the Input is submitted, or focus moves out of the Input. The values "changed", "submitted", and "blur", can be passed as an iterable to the Input parameter validate_on to request that validation occur only on the respective mesages. -(See InputValidationOn and Input.validate_on.) +(See InputValidationOn and Input.validate_on.) For example, the code below creates an Input widget that only gets validated when the value is submitted explicitly:

    input = Input(validate_on=["submitted"])
     

    Validation is considered to have failed if any of the validators fail.

    -

    You can check whether the validation succeeded or failed inside an Input.Changed or -Input.Submitted handler by looking at the validation_result attribute on these events.

    +

    You can check whether the validation succeeded or failed inside an Input.Changed or +Input.Submitted handler by looking at the validation_result attribute on these events.

    In the example below, we show how to combine multiple validators and update the UI to tell the user why validation failed. Click the tabs to see the output for validation failures and successes.

    @@ -8304,8 +8670,8 @@

    Reactive AttributesMessages

    Bindings

    The input widget defines the following bindings:

    @@ -8315,9 +8681,11 @@

    Bindings - - + + +
    + +
    @@ -8379,7 +8747,7 @@

    BindingsComponent Classes

    The input widget provides the following component classes:

    @@ -8389,9 +8757,11 @@

    Bindings - -

    Key(s)
    + + +
    + +
    @@ -8413,7 +8783,7 @@

    BindingsAdditional Notes

      @@ -8425,195 +8795,298 @@

      Bindings + -
      -

      - Bases: Widget

      +
      +

      + Bases: Widget

      - -

      A text input widget.

      - -

      Parameters:

      -

    Class
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

    A text input widget.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    value - str | None -

    An optional default value for the input.

    - None -
    placeholder - str -

    Optional placeholder text for the input.

    - '' -
    highlighter - Highlighter | None -

    An optional highlighter for the input.

    - None -
    password - bool -

    Flag to say if the field should obfuscate its content.

    - False -
    restrict - str | None -

    A regex to restrict character inputs.

    - None -
    type - InputType -

    The type of the input.

    - 'text' -
    max_length - int -

    The maximum length of the input, or 0 for no maximum length.

    - 0 -
    suggester - Suggester | None -

    Suggester associated with this -input instance.

    - None -
    + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    validators - Validator | Iterable[Validator] | None -

    An iterable of validators that the Input value will be checked against.

    - None - NameTypeDescriptionDefault
    validate_on - Iterable[InputValidationOn] | None -

    Zero or more of the values "blur", "changed", and "submitted", +

    +

    value +

    + str | None + +
    +

    An optional default value for the input.

    +
    +
    + None +
    +

    placeholder +

    + str + +
    +

    Optional placeholder text for the input.

    +
    +
    + '' +
    +

    highlighter +

    + Highlighter | None + +
    +

    An optional highlighter for the input.

    +
    +
    + None +
    +

    password +

    + bool + +
    +

    Flag to say if the field should obfuscate its content.

    +
    +
    + False +
    +

    restrict +

    + str | None + +
    +

    A regex to restrict character inputs.

    +
    +
    + None +
    +

    type +

    + InputType + +
    +

    The type of the input.

    +
    +
    + 'text' +
    +

    max_length +

    + int + +
    +

    The maximum length of the input, or 0 for no maximum length.

    +
    +
    + 0 +
    +

    suggester +

    + Suggester | None + +
    +

    Suggester associated with this +input instance.

    +
    +
    + None +
    +

    validators +

    + Validator | Iterable[Validator] | None + +
    +

    An iterable of validators that the Input value will be checked against.

    +
    +
    + None +
    +

    validate_on +

    + Iterable[InputValidationOn] | None + +
    +

    Zero or more of the values "blur", "changed", and "submitted", which determine when to do input validation. The default is to do -validation for all messages.

    - None -
    valid_empty - bool -

    Empty values are valid.

    - False -
    name - str | None -

    Optional name for the input widget.

    - None -
    id - str | None -

    Optional ID for the widget.

    - None -
    classes - str | None -

    Optional initial classes for the widget.

    - None -
    disabled - bool -

    Whether the input is disabled or not.

    - False -
    tooltip - RenderableType | None -

    Optional tooltip.

    - None -
    +validation for all messages.

    + + + + None + + + + +

    valid_empty +

    + + bool + + +
    +

    Empty values are valid.

    +
    + + + False + + + + +

    name +

    + + str | None + + +
    +

    Optional name for the input widget.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    Optional ID for the widget.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    Optional initial classes for the widget.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    Whether the input is disabled or not.

    +
    + + + False + + + + +

    tooltip +

    + + RenderableType | None + + +
    +

    Optional tooltip.

    +
    + + + None + + + + + + + + + + -
    @@ -8627,87 +9100,87 @@

    Bindings - BINDINGS +

    + BINDINGS + - class-attribute -

    -
    BINDINGS: list[BindingType] = [
    -    Binding(
    +

    +
    BINDINGS = [
    +    Binding(
             "left",
             "cursor_left",
             "Move cursor left",
    -        show=False,
    +        show=False,
         ),
    -    Binding(
    +    Binding(
             "ctrl+left",
             "cursor_left_word",
             "Move cursor left a word",
    -        show=False,
    +        show=False,
         ),
    -    Binding(
    +    Binding(
             "right",
             "cursor_right",
             "Move cursor right",
    -        show=False,
    +        show=False,
         ),
    -    Binding(
    +    Binding(
             "ctrl+right",
             "cursor_right_word",
             "Move cursor right a word",
    -        show=False,
    +        show=False,
         ),
    -    Binding(
    +    Binding(
             "backspace",
             "delete_left",
             "Delete character left",
    -        show=False,
    +        show=False,
         ),
    -    Binding(
    -        "home,ctrl+a", "home", "Go to start", show=False
    +    Binding(
    +        "home,ctrl+a", "home", "Go to start", show=False
         ),
    -    Binding("end,ctrl+e", "end", "Go to end", show=False),
    -    Binding(
    +    Binding("end,ctrl+e", "end", "Go to end", show=False),
    +    Binding(
             "delete,ctrl+d",
             "delete_right",
             "Delete character right",
    -        show=False,
    +        show=False,
         ),
    -    Binding("enter", "submit", "Submit", show=False),
    -    Binding(
    +    Binding("enter", "submit", "Submit", show=False),
    +    Binding(
             "ctrl+w",
             "delete_left_word",
             "Delete left to start of word",
    -        show=False,
    +        show=False,
         ),
    -    Binding(
    +    Binding(
             "ctrl+u",
             "delete_left_all",
             "Delete all to the left",
    -        show=False,
    +        show=False,
         ),
    -    Binding(
    +    Binding(
             "ctrl+f",
             "delete_right_word",
             "Delete right to start of word",
    -        show=False,
    +        show=False,
         ),
    -    Binding(
    +    Binding(
             "ctrl+k",
             "delete_right_all",
             "Delete all to the right",
    -        show=False,
    +        show=False,
         ),
     ]
     
    -
    - - +
    + +
    @@ -8769,7 +9242,7 @@

    Key(s)
    -
    +
    @@ -8777,25 +9250,25 @@

    -

    - COMPONENT_CLASSES +

    + COMPONENT_CLASSES + - class-attribute -

    -
    COMPONENT_CLASSES: set[str] = {
    +
    +
    COMPONENT_CLASSES = {
         "input--cursor",
         "input--placeholder",
         "input--suggestion",
     }
     
    -
    - - +
    + +
    @@ -8817,7 +9290,7 @@

    Class
    -
    +
    @@ -8825,22 +9298,22 @@

    -

    - cursor_screen_offset +

    + cursor_screen_offset + - property -

    -
    cursor_screen_offset: Offset
    +
    +
    cursor_screen_offset
     
    -
    - -

    The offset of the cursor of this input in screen-space. (x, y)/(column, row)

    -
    +
    + +

    The offset of the cursor of this input in screen-space. (x, y)/(column, row)

    +
    @@ -8848,22 +9321,22 @@

    - cursor_width +

    + cursor_width + - property -

    -
    cursor_width: int
    +
    +
    cursor_width
     
    -
    - -

    The width of the input (with extra space for cursor at the end).

    -
    +
    + +

    The width of the input (with extra space for cursor at the end).

    +
    @@ -8871,22 +9344,22 @@

    -

    - is_valid +

    + is_valid + - property -

    -
    is_valid: bool
    +
    +
    is_valid
     
    -
    - -

    Check if the value has passed validation.

    -
    +
    + +

    Check if the value has passed validation.

    +
    @@ -8894,23 +9367,23 @@

    -

    - max_length +

    + max_length + - - instance-attribute class-attribute + instance-attribute -

    -
    max_length = max_length
    +
    +
    max_length = max_length
     
    -
    - -

    The maximum length of the input, in characters.

    -
    +
    + +

    The maximum length of the input, in characters.

    +
    @@ -8918,23 +9391,23 @@

    -

    - restrict +

    + restrict + - - instance-attribute class-attribute + instance-attribute -

    -
    restrict = restrict
    +
    +
    restrict = restrict
     
    -
    - -

    A regular expression to limit changes in value.

    -
    +
    + +

    A regular expression to limit changes in value.

    +
    @@ -8942,22 +9415,22 @@

    -

    - suggester +

    + suggester + - instance-attribute -

    -
    suggester: Suggester | None = suggester
    +
    +
    suggester = suggester
     
    -
    - -

    The suggester used to provide completions as the user types.

    -
    +
    + +

    The suggester used to provide completions as the user types.

    +
    @@ -8965,23 +9438,23 @@

    -

    - type +

    + type + - - instance-attribute class-attribute + instance-attribute -

    -
    type = type
    +
    +
    type = type
     
    -
    - -

    The type of the input.

    -
    +
    + +

    The type of the input.

    +
    @@ -8989,23 +9462,23 @@

    -

    - valid_empty +

    + valid_empty + - - instance-attribute class-attribute + instance-attribute -

    -
    valid_empty = var(False)
    +
    +
    valid_empty = var(False)
     
    -
    - -

    Empty values should pass validation.

    -
    +
    + +

    Empty values should pass validation.

    +
    @@ -9013,34 +9486,35 @@

    -

    - validate_on +

    + validate_on + - instance-attribute -

    -
    validate_on: set[str] = (
    -    _POSSIBLE_VALIDATE_ON_VALUES & set(validate_on)
    -    if validate_on is not None
    -    else _POSSIBLE_VALIDATE_ON_VALUES
    +
    +
    validate_on = (
    +    _POSSIBLE_VALIDATE_ON_VALUES & set(validate_on)
    +    if validate_on is not None
    +    else _POSSIBLE_VALIDATE_ON_VALUES
     )
     
    -
    - -

    Set with event names to do input validation on.

    +
    + +

    Set with event names to do input validation on.

    Validation can only be performed on blur, on input changes and on input submission.

    +
    Example

    This creates an Input widget that only gets validated when the value is submitted explicitly:

    input = Input(validate_on=["submitted"])
     
    -
    +
    @@ -9049,29 +9523,35 @@

    -

    - Changed +

    + Changed + - dataclass -

    + +
    Changed(input, value, validation_result=None)
    +
    + +
    +

    + Bases: Message

    -
    -

    - Bases: Message

    - -

    Posted when the value changes.

    +

    Posted when the value changes.

    Can be handled using on_input_changed in a subclass of Input or in a parent widget in the DOM.

    - + + + + +
    @@ -9085,22 +9565,22 @@

    -

    - control +

    + control + - property -

    -
    control: Input
    +
    +
    control
     
    -
    - -

    Alias for self.input.

    -
    +
    + +

    Alias for self.input.

    +
    @@ -9108,22 +9588,22 @@

    -

    - input +

    + input + - instance-attribute -

    -
    input: Input
    +
    +
    input
     
    -
    - -

    The Input widget that was changed.

    -
    +
    + +

    The Input widget that was changed.

    +
    @@ -9131,24 +9611,24 @@

    -

    - validation_result +

    + validation_result + - - instance-attribute class-attribute + instance-attribute -

    -
    validation_result: ValidationResult | None = None
    +
    +
    validation_result = None
     
    -
    - -

    The result of validating the value (formed by combining the results from each validator), or None +

    + +

    The result of validating the value (formed by combining the results from each validator), or None if validation was not performed (for example when no validators are specified in the Inputs init)

    -
    +
    @@ -9156,22 +9636,22 @@

    - value +

    + value + - instance-attribute -

    -
    value: str
    +
    +
    value
     
    -
    - -

    The value that the input was changed to.

    -
    +
    + +

    The value that the input was changed to.

    +
    @@ -9181,7 +9661,7 @@

    -
    +
    @@ -9189,29 +9669,35 @@

    -

    - Submitted +

    + Submitted + - dataclass -

    + +
    Submitted(input, value, validation_result=None)
    +
    + +
    +

    + Bases: Message

    -
    -

    - Bases: Message

    - -

    Posted when the enter key is pressed within an Input.

    +

    Posted when the enter key is pressed within an Input.

    Can be handled using on_input_submitted in a subclass of Input or in a parent widget in the DOM.

    - + + + + +
    @@ -9225,22 +9711,22 @@

    -

    - control +

    + control + - property -

    -
    control: Input
    +
    +
    control
     
    -
    - -

    Alias for self.input.

    -
    +
    + +

    Alias for self.input.

    +
    @@ -9248,22 +9734,22 @@

    -

    - input +

    + input + - instance-attribute -

    -
    input: Input
    +
    +
    input
     
    -
    - -

    The Input widget that is being submitted.

    -
    +
    + +

    The Input widget that is being submitted.

    +
    @@ -9271,25 +9757,25 @@

    -

    - validation_result +

    + validation_result + - - instance-attribute class-attribute + instance-attribute -

    -
    validation_result: ValidationResult | None = None
    +
    +
    validation_result = None
     
    -
    - -

    The result of validating the value on submission, formed by combining the results for each validator. +

    + +

    The result of validating the value on submission, formed by combining the results for each validator. This value will be None if no validation was performed, which will be the case if no validators are supplied to the corresponding Input widget.

    -
    +
    @@ -9297,22 +9783,22 @@

    - value +

    + value + - instance-attribute -

    -
    value: str
    +
    +
    value
     
    -
    - -

    The value of the Input being submitted.

    -
    +
    + +

    The value of the Input being submitted.

    +
    @@ -9322,7 +9808,7 @@

    -
    +
    @@ -9330,469 +9816,481 @@

    - -

    - action_cursor_left +

    + action_cursor_left -

    -
    action_cursor_left()
    +

    +
    action_cursor_left()
     
    -
    - -

    Move the cursor one position to the left.

    +
    -
    +

    Move the cursor one position to the left.

    + +
    +

    + action_cursor_left_word -

    - action_cursor_left_word - -

    -
    action_cursor_left_word()
    +
    +
    action_cursor_left_word()
     
    -
    - -

    Move the cursor left to the start of a word.

    +
    -
    +

    Move the cursor left to the start of a word.

    + +
    - -

    - action_cursor_right +

    + action_cursor_right -

    -
    action_cursor_right()
    +
    +
    action_cursor_right()
     
    -
    - -

    Accept an auto-completion or move the cursor one position to the right.

    +
    -
    +

    Accept an auto-completion or move the cursor one position to the right.

    + +
    - -

    - action_cursor_right_word +

    + action_cursor_right_word -

    -
    action_cursor_right_word()
    +
    +
    action_cursor_right_word()
     
    -
    - -

    Move the cursor right to the start of a word.

    +
    -
    +

    Move the cursor right to the start of a word.

    + +
    - -

    - action_delete_left +

    + action_delete_left -

    -
    action_delete_left()
    +
    +
    action_delete_left()
     
    -
    - -

    Delete one character to the left of the current cursor position.

    +
    -
    +

    Delete one character to the left of the current cursor position.

    + +
    - -

    - action_delete_left_all +

    + action_delete_left_all -

    -
    action_delete_left_all()
    +
    +
    action_delete_left_all()
     
    -
    - -

    Delete all characters to the left of the cursor position.

    +
    -
    +

    Delete all characters to the left of the cursor position.

    + +
    - -

    - action_delete_left_word +

    + action_delete_left_word -

    -
    action_delete_left_word()
    +
    +
    action_delete_left_word()
     
    -
    - -

    Delete leftward of the cursor position to the start of a word.

    +
    -
    +

    Delete leftward of the cursor position to the start of a word.

    + +
    - -

    - action_delete_right +

    + action_delete_right -

    -
    action_delete_right()
    +
    +
    action_delete_right()
     
    -
    - -

    Delete one character at the current cursor position.

    +
    -
    +

    Delete one character at the current cursor position.

    + +
    +

    + action_delete_right_all -

    - action_delete_right_all - -

    -
    action_delete_right_all()
    +
    +
    action_delete_right_all()
     
    -
    - -

    Delete the current character and all characters to the right of the cursor position.

    +
    -
    +

    Delete the current character and all characters to the right of the cursor position.

    + +
    - -

    - action_delete_right_word +

    + action_delete_right_word -

    -
    action_delete_right_word()
    +
    +
    action_delete_right_word()
     
    -
    - -

    Delete the current character and all rightward to the start of the next word.

    +
    -
    +

    Delete the current character and all rightward to the start of the next word.

    + +
    +

    + action_end -

    - action_end - -

    -
    action_end()
    +
    +
    action_end()
     
    -
    - -

    Move the cursor to the end of the input.

    +
    -
    +

    Move the cursor to the end of the input.

    + +
    +

    + action_home -

    - action_home - -

    -
    action_home()
    +
    +
    action_home()
     
    -
    - -

    Move the cursor to the start of the input.

    +
    -
    +

    Move the cursor to the start of the input.

    + +
    +

    + action_submit -

    - action_submit - async -

    -
    action_submit()
    +
    +
    action_submit()
     
    -
    - -

    Handle a submit action.

    +
    + +

    Handle a submit action.

    Normally triggered by the user pressing Enter. This may also run any validators.

    -
    +
    - -

    - check_consume_key +

    + check_consume_key -

    -
    check_consume_key(key, character)
    +
    +
    check_consume_key(key, character)
     
    -
    - -

    Check if the widget may consume the given key.

    +
    + +

    Check if the widget may consume the given key.

    As an input we are expecting to capture printable keys.

    -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    key - str -

    A key identifier.

    - required -
    + - - - - + + + + - -
    character - str | None -

    A character associated with the key, or None if there isn't one.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    key +

    + str + +
    +

    A key identifier.

    +
    +
    + required +
    +

    character +

    + str | None + +
    +

    A character associated with the key, or None if there isn't one.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - bool -

    True if the widget may capture the key in it's Key message, or False if it won't.

    TypeDescription
    + + + + + bool + + +
    +

    True if the widget may capture the key in it's Key message, or False if it won't.

    +
    + + + + -
    +
    +

    + clear -

    - clear - -

    -
    clear()
    +
    +
    clear()
     
    -
    - -

    Clear the input.

    +
    -
    +

    Clear the input.

    + +
    +

    + insert_text_at_cursor -

    - insert_text_at_cursor - -

    -
    insert_text_at_cursor(text)
    +
    +
    insert_text_at_cursor(text)
     
    -
    - -

    Insert new text at the cursor, move the cursor to the end of the new text.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Insert new text at the cursor, move the cursor to the end of the new text.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    text - str -

    New text to insert.

    - required - NameTypeDescriptionDefault
    + + + + +

    text +

    + + str + + +
    +

    New text to insert.

    +
    + + + required + + + + -
    +
    - -

    - restricted +

    + restricted -

    -
    restricted()
    +
    +
    restricted()
     
    -
    - -

    Called when a character has been restricted.

    +
    + +

    Called when a character has been restricted.

    The default behavior is to play the system bell. You may want to override this method if you want to disable the bell or do something else entirely.

    -
    +
    - -

    - validate +

    + validate -

    -
    validate(value)
    +
    +
    validate(value)
     
    -
    - -

    Run all the validators associated with this Input on the supplied value.

    +
    + +

    Run all the validators associated with this Input on the supplied value.

    Runs all validators, combines the result into one. If any of the validators failed, the combined result will be a failure. If no validators are present, None will be returned. This also sets the -invalid CSS class on the Input if the validation fails, and sets the -valid CSS class on the Input if the validation succeeds.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - ValidationResult | None -

    A ValidationResult indicating whether all validators succeeded or not. -That is, if any validator fails, the result will be an unsuccessful -validation.

    TypeDescription
    + + + + + ValidationResult | None + + +
    +

    A ValidationResult indicating whether all validators succeeded or not. +That is, if any validator fails, the result will be an unsuccessful +validation.

    +
    + + + + -
    +
    @@ -9800,7 +10298,7 @@

    -
    +
    diff --git a/widgets/label/index.html b/widgets/label/index.html index ceaacf5b7e..1129c16eec 100644 --- a/widgets/label/index.html +++ b/widgets/label/index.html @@ -4329,7 +4329,7 @@
  • - textual.widgets.Label +  Label @@ -6512,7 +6512,7 @@
  • - textual.widgets.Label +  Label @@ -6733,17 +6733,23 @@

    Component Classes + -
    -

    - Bases: Static

    +
    +

    + Bases: Static

    + + + +

    A simple label widget for displaying text-oriented renderables.

    + + + + - -

    A simple label widget for displaying text-oriented renderables.

    -
    @@ -6759,7 +6765,7 @@

    Component Classes - textual.widgets.ListItem +  ListItem

  • - + - highlighted +  *children + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  highlighted @@ -6521,16 +6566,61 @@
  • - textual.widgets.ListItem +  ListItem + + + +
  • + +
  • + + +  *children + + + +
  • + +
  • + + +  name
  • - + - highlighted +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  highlighted @@ -6782,20 +6872,122 @@

    Component Classes + -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    A widget that is an item within a ListView.

    + + +

    A widget that is an item within a ListView.

    A ListItem is designed for use within a ListView, please see ListView's documentation for more details on use.

    - +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    +

    *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 +
    + + + + + + + +
    @@ -6809,23 +7001,23 @@

    Component Classes - highlighted +

    + highlighted + - - instance-attribute class-attribute + instance-attribute -

    -
    highlighted = reactive(False)
    +

    +
    highlighted = reactive(False)
     
    -
    - -

    Is this item highlighted?

    -
    +
    + +

    Is this item highlighted?

    +
    @@ -6835,7 +7027,7 @@

    -

    +

  • diff --git a/widgets/list_view/index.html b/widgets/list_view/index.html index d42b9287ae..f35e1c31b4 100644 --- a/widgets/list_view/index.html +++ b/widgets/list_view/index.html @@ -4371,80 +4371,134 @@
  • - textual.widgets.ListView +  ListView
  • - + - BINDINGS +  *children
  • - + - highlighted_child +  initial_index
  • - + - index +  name
  • - + - Highlighted +  id -
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  BINDINGS + + + +
  • + +
  • + + +  highlighted_child + + + +
  • + +
  • + + +  index + + + +
  • + +
  • + + +  Highlighted + + + +
  • @@ -7441,22 +7797,22 @@

    -

    - highlighted_child +

    + highlighted_child + - property -

    -
    highlighted_child: ListItem | None
    +
    +
    highlighted_child
     
    -
    - -

    The currently highlighted ListItem, or None if nothing is highlighted.

    -
    +
    + +

    The currently highlighted ListItem, or None if nothing is highlighted.

    +
    @@ -7464,25 +7820,25 @@

    - index +

    + index + - - instance-attribute class-attribute + instance-attribute -

    -
    index = reactive[Optional[int]](
    -    0, always_update=True, init=False
    +
    +
    index = reactive[Optional[int]](
    +    0, always_update=True, init=False
     )
     
    -
    - -

    The index of the currently highlighted item.

    -
    +
    + +

    The index of the currently highlighted item.

    +
    @@ -7491,27 +7847,32 @@

    -

    - Highlighted +

    + Highlighted -

    -
    Highlighted(list_view, item)
    +
    +
    Highlighted(list_view, item)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when the highlighted item changes.

    + + +

    Posted when the highlighted item changes.

    Highlighted item is controlled using up/down keys. Can be handled using on_list_view_highlighted in a subclass of ListView or in a parent widget in the DOM.

    - + + + + +
    @@ -7525,23 +7886,23 @@

    - ALLOW_SELECTOR_MATCH +

    + ALLOW_SELECTOR_MATCH + - - instance-attribute class-attribute + instance-attribute -

    -
    ALLOW_SELECTOR_MATCH = {'item'}
    +
    +
    ALLOW_SELECTOR_MATCH = {'item'}
     
    -
    - -

    Additional message attributes that can be used with the on decorator.

    -
    +
    + +

    Additional message attributes that can be used with the on decorator.

    +
    @@ -7549,24 +7910,24 @@

    - control +

    + control + - property -

    -
    control: ListView
    +
    +
    control
     
    -
    - -

    The view that contains the item highlighted.

    -

    This is an alias for Highlighted.list_view +

    + +

    The view that contains the item highlighted.

    +

    This is an alias for Highlighted.list_view and is used by the on decorator.

    -
    +
    @@ -7574,22 +7935,22 @@

    - item +

    + item + - instance-attribute -

    -
    item: ListItem | None = item
    +
    +
    item = item
     
    -
    - -

    The highlighted item, if there is one highlighted.

    -
    +
    + +

    The highlighted item, if there is one highlighted.

    +
    @@ -7597,22 +7958,22 @@

    - list_view +

    + list_view + - instance-attribute -

    -
    list_view: ListView = list_view
    +
    +
    list_view = list_view
     
    -
    - -

    The view that contains the item highlighted.

    -
    +
    + +

    The view that contains the item highlighted.

    +
    @@ -7622,7 +7983,7 @@

    - Selected +

    + Selected -

    -
    Selected(list_view, item)
    +
    +
    Selected(list_view, item)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when a list item is selected, e.g. when you press the enter key on it.

    + + +

    Posted when a list item is selected, e.g. when you press the enter key on it.

    Can be handled using on_list_view_selected in a subclass of ListView or in a parent widget in the DOM.

    - + + + + +
    @@ -7663,23 +8029,23 @@

    -

    - ALLOW_SELECTOR_MATCH +

    + ALLOW_SELECTOR_MATCH + - - instance-attribute class-attribute + instance-attribute -

    -
    ALLOW_SELECTOR_MATCH = {'item'}
    +
    +
    ALLOW_SELECTOR_MATCH = {'item'}
     
    -
    - -

    Additional message attributes that can be used with the on decorator.

    -
    +
    + +

    Additional message attributes that can be used with the on decorator.

    +
    @@ -7687,24 +8053,24 @@

    - control +

    + control + - property -

    -
    control: ListView
    +
    +
    control
     
    -
    - -

    The view that contains the item selected.

    -

    This is an alias for Selected.list_view +

    + +

    The view that contains the item selected.

    +

    This is an alias for Selected.list_view and is used by the on decorator.

    -
    +
    @@ -7712,22 +8078,22 @@

    - item +

    + item + - instance-attribute -

    -
    item: ListItem = item
    +
    +
    item = item
     
    -
    - -

    The selected item.

    -
    +
    + +

    The selected item.

    +
    @@ -7735,22 +8101,22 @@

    - list_view +

    + list_view + - instance-attribute -

    -
    list_view: ListView = list_view
    +
    +
    list_view = list_view
     
    -
    - -

    The view that contains the item selected.

    -
    +
    + +

    The view that contains the item selected.

    +
    @@ -7760,7 +8126,7 @@

    +

    + action_cursor_down -

    - action_cursor_down - -

    -
    action_cursor_down()
    +
    +
    action_cursor_down()
     
    -
    - -

    Highlight the next item in the list.

    +
    -
    +

    Highlight the next item in the list.

    + +
    +

    + action_cursor_up -

    - action_cursor_up - -

    -
    action_cursor_up()
    +
    +
    action_cursor_up()
     
    -
    - -

    Highlight the previous item in the list.

    +
    -
    +

    Highlight the previous item in the list.

    + +
    +

    + action_select_cursor -

    - action_select_cursor - -

    -
    action_select_cursor()
    +
    +
    action_select_cursor()
     
    -
    - -

    Select the current item in the list.

    +
    -
    +

    Select the current item in the list.

    + +
    - -

    - append +

    + append -

    -
    append(item)
    +
    +
    append(item)
     
    -
    - -

    Append a new ListItem to the end of the ListView.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Append a new ListItem to the end of the ListView.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    item - ListItem -

    The ListItem to append.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    item +

    + ListItem + +
    +

    The ListItem to append.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - AwaitMount -

    An awaitable that yields control to the event loop -until the DOM has been updated with the new child item.

    TypeDescription
    + + + + + AwaitMount + + +
    +

    An awaitable that yields control to the event loop +until the DOM has been updated with the new child item.

    +
    + + + + -
    +
    - -

    - clear +

    + clear -

    -
    clear()
    +
    +
    clear()
     
    -
    - -

    Clear all items from the ListView.

    +
    + +

    Clear all items from the ListView.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - AwaitRemove -

    An awaitable that yields control to the event loop until -the DOM has been updated to reflect all children being removed.

    TypeDescription
    + + + + + AwaitRemove + + +
    +

    An awaitable that yields control to the event loop until +the DOM has been updated to reflect all children being removed.

    +
    + + + + -
    +
    - -

    - extend +

    + extend -

    -
    extend(items)
    +
    +
    extend(items)
     
    -
    - -

    Append multiple new ListItems to the end of the ListView.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Append multiple new ListItems to the end of the ListView.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    items - Iterable[ListItem] -

    The ListItems to append.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    items +

    + Iterable[ListItem] + +
    +

    The ListItems to append.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - AwaitMount -

    An awaitable that yields control to the event loop -until the DOM has been updated with the new child items.

    TypeDescription
    + + + + + AwaitMount + + +
    +

    An awaitable that yields control to the event loop +until the DOM has been updated with the new child items.

    +
    + + + + -
    +
    +

    + insert -

    - insert - -

    -
    insert(index, items)
    +
    +
    insert(index, items)
     
    -
    - -

    Insert new ListItem(s) to specified index.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Insert new ListItem(s) to specified index.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    index - int -

    index to insert new ListItem.

    - required -
    + - - - - + + + + - -
    items - Iterable[ListItem] -

    The ListItems to insert.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    index +

    + int + +
    +

    index to insert new ListItem.

    +
    +
    + required +
    +

    items +

    + Iterable[ListItem] + +
    +

    The ListItems to insert.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - AwaitMount -

    An awaitable that yields control to the event loop -until the DOM has been updated with the new child item.

    TypeDescription
    + + + + + AwaitMount + + +
    +

    An awaitable that yields control to the event loop +until the DOM has been updated with the new child item.

    +
    + + + + -
    +
    +

    + pop -

    - pop - -

    -
    pop(index=None)
    +
    +
    pop(index=None)
     
    -
    - -

    Remove last ListItem from ListView or +

    + +

    Remove last ListItem from ListView or Remove ListItem from ListView by index

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    index - Optional[int] -

    index of ListItem to remove from ListView

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    index +

    + Optional[int] + +
    +

    index of ListItem to remove from ListView

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - AwaitRemove -

    An awaitable that yields control to the event loop until -the DOM has been updated to reflect item being removed.

    TypeDescription
    + + + + + AwaitRemove + + +
    +

    An awaitable that yields control to the event loop until +the DOM has been updated to reflect item being removed.

    +
    + + + + -
    +
    - -

    - remove_items +

    + remove_items -

    -
    remove_items(indices)
    +
    +
    remove_items(indices)
     
    -
    - -

    Remove ListItems from ListView by indices

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Remove ListItems from ListView by indices

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    indices - Iterable[int] -

    index(s) of ListItems to remove from ListView

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    indices +

    + Iterable[int] + +
    +

    index(s) of ListItems to remove from ListView

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - AwaitRemove -

    An awaitable object that waits for the direct children to be removed.

    TypeDescription
    + + + + + AwaitRemove + + +
    +

    An awaitable object that waits for the direct children to be removed.

    +
    + + + + -
    +
    - -

    - validate_index +

    + validate_index -

    -
    validate_index(index)
    +
    +
    validate_index(index)
     
    -
    - -

    Clamp the index to the valid range, or set to None if there's nothing to highlight.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Clamp the index to the valid range, or set to None if there's nothing to highlight.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    index - int | None -

    The index to clamp.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    index +

    + int | None + +
    +

    The index to clamp.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - int | None -

    The clamped index.

    TypeDescription
    + + + + + int | None + + +
    +

    The clamped index.

    +
    + + + + -
    +
    +

    + watch_index -

    - watch_index - -

    -
    watch_index(old_index, new_index)
    +
    +
    watch_index(old_index, new_index)
     
    -
    - -

    Updates the highlighting when the index changes.

    +
    -
    +

    Updates the highlighting when the index changes.

    + +
    @@ -8275,7 +8713,7 @@

    -

    +
    diff --git a/widgets/loading_indicator/index.html b/widgets/loading_indicator/index.html index 649f519be8..c6d2bd2bf3 100644 --- a/widgets/loading_indicator/index.html +++ b/widgets/loading_indicator/index.html @@ -4401,7 +4401,43 @@
  • - textual.widgets.LoadingIndicator +  LoadingIndicator + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled @@ -6530,7 +6566,43 @@
  • - textual.widgets.LoadingIndicator +  LoadingIndicator + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled @@ -6769,72 +6841,103 @@

    Component Classes + -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    Display an animated loading indicator.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

    Display an animated loading indicator.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    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 - NameTypeDescriptionDefault
    + + + + +

    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 + + + + + + + + + + -
    @@ -6850,7 +6953,7 @@

    Component Classes - textual.widgets.Log +  Log

  • - + - auto_scroll +  highlight
  • - + - highlight +  max_lines
  • - + - highlighter +  auto_scroll
  • - + - line_count +  name
  • - + - lines +  id
  • - + - max_lines +  classes
  • - + - clear() +  disabled
  • - + - notify_style_update() +  auto_scroll
  • - + - refresh_lines() +  highlight
  • - + - write() +  highlighter
  • - + - write_line() +  line_count
  • - + - write_lines() +  lines +
  • + +
  • + + +  max_lines + + + +
  • + +
  • + + +  clear + + + +
  • + +
  • + + +  notify_style_update + + + +
  • + +
  • + + +  refresh_lines + + + + + +
  • + +
  • + + +  write + + + + + +
  • + +
  • + + +  write_line + + + + + +
  • + +
  • + + +  write_lines + + + + +
  • @@ -6620,118 +6770,268 @@
  • - textual.widgets.Log +  Log
  • - + - auto_scroll +  highlight
  • - + - highlight +  max_lines
  • - + - highlighter +  auto_scroll
  • - + - line_count +  name
  • - + - lines +  id
  • - + - max_lines +  classes
  • - + - clear() +  disabled
  • - + - notify_style_update() +  auto_scroll
  • - + - refresh_lines() +  highlight
  • - + + +  highlighter + + + +
  • + +
  • + + +  line_count + + + +
  • + +
  • + + +  lines + + + +
  • + +
  • + + +  max_lines + + + +
  • + +
  • + + +  clear + + + +
  • + +
  • + + +  notify_style_update + + + +
  • + +
  • + + +  refresh_lines + + + + + +
  • + +
  • + - write() +  write + + + + +
  • - + + +  write_line + + + + +
  • - + + +  write_lines + + + + +
  • @@ -6757,7 +7057,7 @@

    Log¶<

    Added in version 0.32.0

    A Log widget displays lines of text which may be appended to in realtime.

    -

    Call Log.write_line to write a line at a time, or Log.write_lines to write multiple lines at once. Call Log.clear to clear the Log widget.

    +

    Call Log.write_line to write a line at a time, or Log.write_lines to write multiple lines at once. Call Log.clear to clear the Log widget.

    Tip

    See also RichLog which can write more than just text, and supports a number of advanced features.

    @@ -6995,102 +7295,151 @@

    Component Classes + -
    -

    - Bases: ScrollView

    +
    +

    + Bases: ScrollView

    - -

    A widget to log text.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

    A widget to log text.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    highlight - bool -

    Enable highlighting.

    - False -
    max_lines - int | None -

    Maximum number of lines to display.

    - None -
    auto_scroll - bool -

    Scroll to end on new lines.

    - True -
    name - str | None -

    The name of the text log.

    - None -
    id - str | None -

    The ID of the text log in the DOM.

    - None -
    classes - str | None -

    The CSS classes of the text log.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    Whether the text log is disabled or not.

    - False - NameTypeDescriptionDefault
    + + + + +

    highlight +

    + + bool + + +
    +

    Enable highlighting.

    +
    + + + False + + + + +

    max_lines +

    + + int | None + + +
    +

    Maximum number of lines to display.

    +
    + + + None + + + + +

    auto_scroll +

    + + bool + + +
    +

    Scroll to end on new lines.

    +
    + + + True + + + + +

    name +

    + + str | None + + +
    +

    The name of the text log.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    The ID of the text log in the DOM.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    The CSS classes of the text log.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    Whether the text log is disabled or not.

    +
    + + + False + + + + + + + + + + -
    @@ -7104,23 +7453,23 @@

    Component Classes - auto_scroll +

    + auto_scroll + - - instance-attribute class-attribute + instance-attribute -

    -
    auto_scroll: var[bool] = auto_scroll
    +

    +
    auto_scroll = auto_scroll
     
    -
    - -

    Automatically scroll to new lines.

    -
    +
    + +

    Automatically scroll to new lines.

    +
    @@ -7128,22 +7477,22 @@

    -

    - highlight +

    + highlight + - instance-attribute -

    -
    highlight = highlight
    +

    +
    highlight = highlight
     
    -
    - -

    Enable highlighting.

    -
    +
    + +

    Enable highlighting.

    +
    @@ -7151,22 +7500,22 @@

    -

    - highlighter +

    + highlighter + - instance-attribute -

    -
    highlighter: Highlighter = ReprHighlighter()
    +
    +
    highlighter = ReprHighlighter()
     
    -
    - -

    The Rich Highlighter object to use, if highlight=True

    -
    +
    + +

    The Rich Highlighter object to use, if highlight=True

    +
    @@ -7174,22 +7523,22 @@

    -

    - line_count +

    + line_count + - property -

    -
    line_count: int
    +
    +
    line_count
     
    -
    - -

    Number of lines of content.

    -
    +
    + +

    Number of lines of content.

    +
    @@ -7197,24 +7546,24 @@

    -

    - lines +

    + lines + - property -

    -
    lines: Sequence[str]
    +
    +
    lines
     
    -
    - -

    The raw lines in the Log.

    +
    + +

    The raw lines in the Log.

    Note that this attribute is read only. Changing the lines will not update the Log's contents.

    -
    +
    @@ -7222,23 +7571,23 @@

    -

    - max_lines +

    + max_lines + - - instance-attribute class-attribute + instance-attribute -

    -
    max_lines: var[int | None] = max_lines
    +
    +
    max_lines = max_lines
     
    -
    - -

    Maximum number of lines to show

    -
    +
    + +

    Maximum number of lines to show

    +
    @@ -7247,318 +7596,378 @@

    - -

    - clear +

    + clear -

    -
    clear()
    +

    +
    clear()
     
    -
    - -

    Clear the Log.

    +
    + +

    Clear the Log.

    + -

    Returns:

    - - - - - - - - +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The Log instance.

    TypeDescription
    + + + + + Self + + +
    +

    The Log instance.

    +
    + + + + -
    +
    +

    + notify_style_update -

    - notify_style_update - -

    -
    notify_style_update()
    +
    +
    notify_style_update()
     
    -
    - -

    Called by Textual when styles update.

    +
    -
    +

    Called by Textual when styles update.

    + +
    +

    + refresh_lines -

    - refresh_lines - -

    -
    refresh_lines(y_start, line_count=1)
    +
    +
    refresh_lines(y_start, line_count=1)
     
    -
    - -

    Refresh one or more lines.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Refresh one or more lines.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    y_start - int -

    First line to refresh.

    - required -
    + - - - - + + + + - -
    line_count - int -

    Total number of lines to refresh.

    - 1 - NameTypeDescriptionDefault
    + + + + +

    y_start +

    + + int + + +
    +

    First line to refresh.

    +
    + + + required + + + + +

    line_count +

    + + int + + +
    +

    Total number of lines to refresh.

    +
    + + + 1 + + + + -
    +
    +

    + write -

    - write - -

    -
    write(data, scroll_end=None)
    +
    +
    write(data, scroll_end=None)
     
    -
    - -

    Write to the log.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Write to the log.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    data - str -

    Data to write.

    - required -
    + - - - - + + + + - -
    scroll_end - bool | None -

    Scroll to the end after writing, or None to use self.auto_scroll.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    data +

    + str + +
    +

    Data to write.

    +
    +
    + required +
    +

    scroll_end +

    + bool | None + +
    +

    Scroll to the end after writing, or None to use self.auto_scroll.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The Log instance.

    TypeDescription
    + + + + + Self + + +
    +

    The Log instance.

    +
    + + + + -
    +
    - -

    - write_line +

    + write_line -

    -
    write_line(line)
    +
    +
    write_line(line)
     
    -
    - -

    Write content on a new line.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Write content on a new line.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    line - str -

    String to write to the log.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    line +

    + str + +
    +

    String to write to the log.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The Log instance.

    TypeDescription
    + + + + + Self + + +
    +

    The Log instance.

    +
    + + + + -
    +
    - -

    - write_lines +

    + write_lines -

    -
    write_lines(lines, scroll_end=None)
    +
    +
    write_lines(lines, scroll_end=None)
     
    -
    - -

    Write an iterable of lines.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Write an iterable of lines.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    lines - Iterable[str] -

    An iterable of strings to write.

    - required -
    + - - - - + + + + - -
    scroll_end - bool | None -

    Scroll to the end after writing, or None to use self.auto_scroll.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    lines +

    + Iterable[str] + +
    +

    An iterable of strings to write.

    +
    +
    + required +
    +

    scroll_end +

    + bool | None + +
    +

    Scroll to the end after writing, or None to use self.auto_scroll.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The Log instance.

    TypeDescription
    + + + + + Self + + +
    +

    The Log instance.

    +
    + + + + -
    +
    @@ -7566,7 +7975,7 @@

    -
    +
    diff --git a/widgets/markdown/index.html b/widgets/markdown/index.html index 4a76e0d583..02ec4fc23d 100644 --- a/widgets/markdown/index.html +++ b/widgets/markdown/index.html @@ -4464,71 +4464,116 @@
  • - textual.widgets.Markdown +  Markdown
  • - + - COMPONENT_CLASSES +  markdown
  • - + - code_dark_theme +  name
  • - + - code_light_theme +  id
  • - + - LinkClicked +  classes -
  • + +
  • + + +  parser_factory + + + +
  • + +
  • + + +  COMPONENT_CLASSES + + + +
  • + +
  • + + +  code_dark_theme + + + +
  • + +
  • + + +  code_light_theme + + + +
  • + +
  • + + +  LinkClicked + + + +
  • +

    + sanitize_location -

    - sanitize_location - staticmethod -

    -
    sanitize_location(location)
    +
    +
    sanitize_location(location)
     
    -
    - -

    Given a location, break out the path and any anchor.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - -
    NameTypeDescriptionDefault
    location - str -

    The location to sanitize.

    - required -
    - -

    Returns:

    - - - - - - - - +
    + +

    Given a location, break out the path and any anchor.

    + + +

    Parameters:

    +
    TypeDescription
    + - - + + + + + + + + + + + + + +
    - Path -

    A tuple of the path to the location cleaned of any anchor, plus

    NameTypeDescriptionDefault
    +

    location +

    + str + +
    +

    The location to sanitize.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - str -

    the anchor (or an empty string if none was found).

    TypeDescription
    + + + + + Path + + +
    +

    A tuple of the path to the location cleaned of any anchor, plus

    +
    + + + + + str + + +
    +

    the anchor (or an empty string if none was found).

    +
    + + + + -
    +
    - -

    - unhandled_token +

    + unhandled_token -

    -
    unhandled_token(token)
    +
    +
    unhandled_token(token)
     
    -
    - -

    Process an unhandled token.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Process an unhandled token.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    token - Token -

    The MarkdownIt token to handle.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    token +

    + Token + +
    +

    The MarkdownIt token to handle.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - MarkdownBlock | None -

    Either a widget to be added to the output, or None.

    TypeDescription
    + + + + + MarkdownBlock | None + + +
    +

    Either a widget to be added to the output, or None.

    +
    + + + + -
    +
    - -

    - update +

    + update -

    -
    update(markdown)
    +
    +
    update(markdown)
     
    -
    - -

    Update the document with new Markdown.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Update the document with new Markdown.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    markdown - str -

    A string containing Markdown.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    markdown +

    + str + +
    +

    A string containing Markdown.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - AwaitComplete -

    An optionally awaitable object. Await this to ensure that all children have been mounted.

    TypeDescription
    + + + + + AwaitComplete + + +
    +

    An optionally awaitable object. Await this to ensure that all children have been mounted.

    +
    + + + + -
    +
    @@ -8079,7 +8434,7 @@

    -
    +
    diff --git a/widgets/markdown_viewer/index.html b/widgets/markdown_viewer/index.html index 84350ef2ab..c0fcbbb6f7 100644 --- a/widgets/markdown_viewer/index.html +++ b/widgets/markdown_viewer/index.html @@ -4443,61 +4443,115 @@
  • - textual.widgets.MarkdownViewer +  MarkdownViewer
  • - + - document +  markdown
  • - + - table_of_contents +  show_table_of_contents
  • - + - NavigatorUpdated +  name
  • - + - back() +  id
  • - + - forward() +  classes
  • - + - go() +  parser_factory + + + +
  • + +
  • + + +  document + + + +
  • + +
  • + + +  table_of_contents + + + +
  • + +
  • + + +  NavigatorUpdated + + + +
  • + +
  • + + +  back + + + +
  • + +
  • + + +  forward + + + +
  • + +
  • + + +  go @@ -4506,17 +4560,17 @@
  • - markdown +  markdown -
  • @@ -7846,96 +8387,115 @@

    - NavigatorUpdated +

    + NavigatorUpdated + + +

    +
    NavigatorUpdated()
    +
    + +
    +

    + Bases: Message

    + + + +

    Navigator has been changed (clicked link etc).

    + + + + + + + + + +
    + + + - -
    -

    - Bases: Message

    - -

    Navigator has been changed (clicked link etc).

    +
    +
    +

    + back -

    - back - async -

    -
    back()
    +
    +
    back()
     
    -
    - -

    Go back one level in the history.

    +
    -
    +

    Go back one level in the history.

    + +
    +

    + forward -

    - forward - async -

    -
    forward()
    +
    +
    forward()
     
    -
    - -

    Go forward one level in the history.

    +
    -
    +

    Go forward one level in the history.

    + +
    +

    + go -

    - go - async -

    -
    go(location)
    +
    +
    go(location)
     
    -
    - -

    Navigate to a new document path.

    +
    -
    +

    Navigate to a new document path.

    + +
    @@ -7943,7 +8503,7 @@

    -
    +
    @@ -7952,14 +8512,19 @@

    - textual.widgets.markdown + textual.widgets.markdown

    -
    +
    + + + + + + -
    @@ -7974,24 +8539,22 @@

    - TableOfContentsType + TableOfContentsType + - module-attribute

    -
    TableOfContentsType: TypeAlias = (
    -    "list[tuple[int, str, str | None]]"
    -)
    +
    TableOfContentsType = 'list[tuple[int, str, str | None]]'
     
    -
    - -

    Information about the table of contents of a markdown document.

    +
    + +

    Information about the table of contents of a markdown document.

    The triples encode the level, the label, and the optional block id of each heading.

    -
    +
    @@ -8001,93 +8564,129 @@

    - Markdown + Markdown

    -
    Markdown(
    -    markdown=None,
    +
    Markdown(
    +    markdown=None,
         *,
    -    name=None,
    -    id=None,
    -    classes=None,
    -    parser_factory=None
    +    name=None,
    +    id=None,
    +    classes=None,
    +    parser_factory=None
     )
     
    -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    markdown - str | None -

    String containing Markdown or None to leave blank for now.

    - None -
    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 of the widget.

    - None -
    + - - - - + + + + - -
    parser_factory - Callable[[], MarkdownIt] | None -

    A factory function to return a configured MarkdownIt instance. If None, a "gfm-like" parser is used.

    - None - NameTypeDescriptionDefault
    + + + + +

    markdown +

    + + str | None + + +
    +

    String containing Markdown or None to leave blank for now.

    +
    + + + None + + + + +

    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 of the widget.

    +
    + + + None + + + + +

    parser_factory +

    + + Callable[[], MarkdownIt] | None + + +
    +

    A factory function to return a configured MarkdownIt instance. If None, a "gfm-like" parser is used.

    +
    + + + None + + + + + + + + + + -
    @@ -8101,22 +8700,22 @@

    -

    - COMPONENT_CLASSES +

    + COMPONENT_CLASSES + - - instance-attribute class-attribute + instance-attribute -

    -
    COMPONENT_CLASSES = {'em', 'strong', 's', 'code_inline'}
    +
    +
    COMPONENT_CLASSES = {'em', 'strong', 's', 'code_inline'}
     
    -
    - -

    These component classes target standard inline markdown styles. +

    + +

    These component classes target standard inline markdown styles. Changing these will potentially break the standard markdown formatting.

    @@ -8144,7 +8743,7 @@

    - code_dark_theme +

    + code_dark_theme + - - instance-attribute class-attribute + instance-attribute -

    -
    code_dark_theme: reactive[str] = reactive('material')
    +
    +
    code_dark_theme = reactive('material')
     
    -
    - -

    The theme to use for code blocks when in dark mode.

    -
    +
    + +

    The theme to use for code blocks when in dark mode.

    +
    @@ -8176,23 +8775,23 @@

    - code_light_theme +

    + code_light_theme + - - instance-attribute class-attribute + instance-attribute -

    -
    code_light_theme: reactive[str] = reactive("material-light")
    +
    +
    code_light_theme = reactive('material-light')
     
    -
    - -

    The theme to use for code blocks when in light mode.

    -
    +
    + +

    The theme to use for code blocks when in light mode.

    +
    @@ -8201,24 +8800,29 @@

    - LinkClicked +

    + LinkClicked -

    -
    LinkClicked(markdown, href)
    +
    +
    LinkClicked(markdown, href)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    + + + +

    A link in the document was clicked.

    + + + + - -

    A link in the document was clicked.

    -
    @@ -8232,24 +8836,24 @@

    -

    - control +
    + control + - property -
    -
    control: Markdown
    +
    +
    control
     
    -
    - -

    The Markdown widget containing the link clicked.

    -

    This is an alias for LinkClicked.markdown +

    + +

    The Markdown widget containing the link clicked.

    +

    This is an alias for LinkClicked.markdown and is used by the on decorator.

    -
    +
    @@ -8257,22 +8861,22 @@
    - href +
    + href + - instance-attribute -
    -
    href: str = unquote(href)
    +
    +
    href = unquote(href)
     
    -
    - -

    The link that was selected.

    -
    +
    + +

    The link that was selected.

    +
    @@ -8280,22 +8884,22 @@
    - markdown +
    + markdown + - instance-attribute -
    -
    markdown: Markdown = markdown
    +
    +
    markdown = markdown
     
    -
    - -

    The Markdown widget containing the link clicked.

    -
    +
    + +

    The Markdown widget containing the link clicked.

    +
    @@ -8305,7 +8909,7 @@
    - TableOfContentsSelected +

    + TableOfContentsSelected -

    -
    TableOfContentsSelected(markdown, block_id)
    +
    +
    TableOfContentsSelected(markdown, block_id)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    + + + +

    An item in the TOC was selected.

    + + + + - -

    An item in the TOC was selected.

    -
    @@ -8344,22 +8953,22 @@

    - block_id +

    + block_id + - instance-attribute -
    -
    block_id: str = block_id
    +
    +
    block_id = block_id
     
    -
    - -

    ID of the block that was selected.

    -
    +
    + +

    ID of the block that was selected.

    +
    @@ -8367,24 +8976,24 @@
    - control +
    + control + - property -
    -
    control: Markdown
    +
    +
    control
     
    -
    - -

    The Markdown widget where the selected item is.

    -

    This is an alias for TableOfContentsSelected.markdown +

    + +

    The Markdown widget where the selected item is.

    +

    This is an alias for TableOfContentsSelected.markdown and is used by the on decorator.

    -
    +
    @@ -8392,22 +9001,22 @@
    - markdown +
    + markdown + - instance-attribute -
    -
    markdown: Markdown = markdown
    +
    +
    markdown = markdown
     
    -
    - -

    The Markdown widget where the selected item is.

    -
    +
    + +

    The Markdown widget where the selected item is.

    +
    @@ -8417,7 +9026,7 @@
    -
    +
    @@ -8425,24 +9034,29 @@
    - TableOfContentsUpdated +

    + TableOfContentsUpdated -

    -
    TableOfContentsUpdated(markdown, table_of_contents)
    +
    +
    TableOfContentsUpdated(markdown, table_of_contents)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    + + + +

    The table of contents was updated.

    + + + + - -

    The table of contents was updated.

    -
    @@ -8456,24 +9070,24 @@

    - control +

    + control + - property -
    -
    control: Markdown
    +
    +
    control
     
    -
    - -

    The Markdown widget associated with the table of contents.

    -

    This is an alias for TableOfContentsUpdated.markdown +

    + +

    The Markdown widget associated with the table of contents.

    +

    This is an alias for TableOfContentsUpdated.markdown and is used by the on decorator.

    -
    +
    @@ -8481,22 +9095,22 @@
    - markdown +
    + markdown + - instance-attribute -
    -
    markdown: Markdown = markdown
    +
    +
    markdown = markdown
     
    -
    - -

    The Markdown widget associated with the table of contents.

    -
    +
    + +

    The Markdown widget associated with the table of contents.

    +
    @@ -8504,22 +9118,22 @@
    - table_of_contents +
    + table_of_contents + - instance-attribute -
    -
    table_of_contents: TableOfContentsType = table_of_contents
    +
    +
    table_of_contents = table_of_contents
     
    -
    - -

    Table of contents.

    -
    +
    + +

    Table of contents.

    +
    @@ -8529,7 +9143,7 @@
    +

    + goto_anchor -

    - goto_anchor - -

    -
    goto_anchor(anchor)
    +
    +
    goto_anchor(anchor)
     
    -
    - -

    Try and find the given anchor in the current document.

    - -

    Parameters:

    -
    - - - - - - - - - +
    + +

    Try and find the given anchor in the current document.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    anchor - str -

    The anchor to try and find.

    - required - NameTypeDescriptionDefault
    + + + + +
    anchor +
    + + str + + +
    +

    The anchor to try and find.

    +
    + + + required + + + + +
    Note @@ -8582,292 +9203,346 @@

    Note that the slugging method used is similar to that found on GitHub.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - bool -

    True when the anchor was found in the current document, False otherwise.

    TypeDescription
    + + + + + bool + + +
    +

    True when the anchor was found in the current document, False otherwise.

    +
    + + + + -
    +
    +

    + load -

    - load - async -

    -
    load(path)
    +
    +
    load(path)
     
    -
    - -

    Load a new Markdown document.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Load a new Markdown document.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    path - Path -

    Path to the document.

    - required - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +
    path +
    + Path + +
    +

    Path to the document.

    +
    +
    + required +
    + + +

    Raises:

    + + - - + + - -
    - OSError -

    If there was some form of error loading the document.

    TypeDescription
    + + + + + OSError + + +
    +

    If there was some form of error loading the document.

    +
    + + + + +
    Note

    The exceptions that can be raised by this method are all of those that can be raised by calling Path.read_text.

    -
    +
    +

    + sanitize_location -

    - sanitize_location - staticmethod -

    -
    sanitize_location(location)
    +
    +
    sanitize_location(location)
     
    -
    - -

    Given a location, break out the path and any anchor.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - -
    NameTypeDescriptionDefault
    location - str -

    The location to sanitize.

    - required -
    - -

    Returns:

    - - - - - - - - +
    + +

    Given a location, break out the path and any anchor.

    + + +

    Parameters:

    +
    TypeDescription
    + - - + + + + + + + + + + + + + +
    - Path -

    A tuple of the path to the location cleaned of any anchor, plus

    NameTypeDescriptionDefault
    +
    location +
    + str + +
    +

    The location to sanitize.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - str -

    the anchor (or an empty string if none was found).

    TypeDescription
    + + + + + Path + + +
    +

    A tuple of the path to the location cleaned of any anchor, plus

    +
    + + + + + str + + +
    +

    the anchor (or an empty string if none was found).

    +
    + + + + -
    +
    +

    + unhandled_token -

    - unhandled_token - -

    -
    unhandled_token(token)
    +
    +
    unhandled_token(token)
     
    -
    - -

    Process an unhandled token.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Process an unhandled token.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    token - Token -

    The MarkdownIt token to handle.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +
    token +
    + Token + +
    +

    The MarkdownIt token to handle.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - MarkdownBlock | None -

    Either a widget to be added to the output, or None.

    TypeDescription
    + + + + + MarkdownBlock | None + + +
    +

    Either a widget to be added to the output, or None.

    +
    + + + + -
    +
    - -

    - update +

    + update -

    -
    update(markdown)
    +
    +
    update(markdown)
     
    -
    - -

    Update the document with new Markdown.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Update the document with new Markdown.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    markdown - str -

    A string containing Markdown.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +
    markdown +
    + str + +
    +

    A string containing Markdown.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - AwaitComplete -

    An optionally awaitable object. Await this to ensure that all children have been mounted.

    TypeDescription
    + + + + + AwaitComplete + + +
    +

    An optionally awaitable object. Await this to ensure that all children have been mounted.

    +
    + + + + -
    +
    @@ -8875,7 +9550,7 @@

    -
    +
    @@ -8884,23 +9559,28 @@

    - MarkdownBlock + MarkdownBlock

    -
    MarkdownBlock(markdown, *args, **kwargs)
    +
    MarkdownBlock(markdown, *args, **kwargs)
     
    -
    -

    - Bases: Static

    +
    +

    + Bases: Static

    + + + +

    The base class for a Markdown Element.

    + + + + - -

    The base class for a Markdown Element.

    -
    @@ -8915,113 +9595,116 @@

    + -
    action_link(href)
    +

    +
    action_link(href)
     
    -
    - -

    Called on link click.

    +
    -
    +

    Called on link click.

    + +
    - -

    - build_from_token +

    + build_from_token -

    -
    build_from_token(token)
    +
    +
    build_from_token(token)
     
    -
    - -

    Build the block content from its source token.

    +
    + +

    Build the block content from its source token.

    This method allows the block to be rebuilt on demand, which is useful when the styles assigned to the -Markdown.COMPONENT_CLASSES +Markdown.COMPONENT_CLASSES change.

    See https://github.com/Textualize/textual/issues/3464 for more information.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    token - Token -

    The token from which this block is built.

    - required - NameTypeDescriptionDefault
    + + + + +
    token +
    + + Token + + +
    +

    The token from which this block is built.

    +
    + + + required + + + + -
    +
    +

    + notify_style_update -

    - notify_style_update - -

    -
    notify_style_update()
    +
    +
    notify_style_update()
     
    -
    - -

    If CSS was reloaded, try to rebuild this block from its token.

    +
    -
    +

    If CSS was reloaded, try to rebuild this block from its token.

    + +
    +

    + rebuild -

    - rebuild - -

    -
    rebuild()
    +
    +
    rebuild()
     
    -
    - -

    Rebuild the content of the block if we have a source token.

    +
    -
    +

    Rebuild the content of the block if we have a source token.

    + +
    @@ -9029,7 +9712,7 @@

    -

    +
    @@ -9038,94 +9721,130 @@

    - MarkdownTableOfContents + MarkdownTableOfContents

    -
    MarkdownTableOfContents(
    -    markdown,
    -    name=None,
    -    id=None,
    -    classes=None,
    -    disabled=False,
    +
    MarkdownTableOfContents(
    +    markdown,
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False,
     )
     
    -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    Displays a table of contents for a markdown document.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

    Displays a table of contents for a markdown document.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    markdown - Markdown -

    The Markdown document associated with this table of contents.

    - required -
    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 - NameTypeDescriptionDefault
    + + + + +

    markdown +

    + + Markdown + + +
    +

    The Markdown document associated with this table of contents.

    +
    + + + required + + + + +

    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 + + + + + + + + + + -
    @@ -9139,22 +9858,22 @@

    - markdown +

    + markdown + - instance-attribute -

    -
    markdown: Markdown = markdown
    +
    +
    markdown = markdown
     
    -
    - -

    The Markdown document associated with this table of contents.

    -
    +
    + +

    The Markdown document associated with this table of contents.

    +
    @@ -9162,25 +9881,25 @@

    - table_of_contents +

    + table_of_contents + - - instance-attribute class-attribute + instance-attribute -

    -
    table_of_contents = reactive[Optional[TableOfContentsType]](
    -    None, init=False
    +
    +
    table_of_contents = reactive[Optional[TableOfContentsType]](
    +    None, init=False
     )
     
    -
    - -

    Underlying data to populate the table of contents widget.

    -
    +
    + +

    Underlying data to populate the table of contents widget.

    +
    @@ -9189,64 +9908,69 @@

    +

    + rebuild_table_of_contents -

    - rebuild_table_of_contents - -

    -
    rebuild_table_of_contents(table_of_contents)
    +
    +
    rebuild_table_of_contents(table_of_contents)
     
    -
    - -

    Rebuilds the tree representation of the table of contents data.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Rebuilds the tree representation of the table of contents data.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    table_of_contents - TableOfContentsType -

    Table of contents.

    - required - NameTypeDescriptionDefault
    + + + + +
    table_of_contents +
    + + TableOfContentsType + + +
    +

    Table of contents.

    +
    + + + required + + + + -
    +
    - -

    - watch_table_of_contents +

    + watch_table_of_contents -

    -
    watch_table_of_contents(table_of_contents)
    +
    +
    watch_table_of_contents(table_of_contents)
     
    -
    - -

    Triggered when the table of contents changes.

    +
    -
    +

    Triggered when the table of contents changes.

    + +
    @@ -9254,7 +9978,7 @@

    -

    +
    diff --git a/widgets/masked_input/index.html b/widgets/masked_input/index.html index 61ee188031..7323d0ca40 100644 --- a/widgets/masked_input/index.html +++ b/widgets/masked_input/index.html @@ -4491,142 +4491,256 @@
  • - textual.widgets.MaskedInput +  MaskedInput
  • - + - template +  template
  • - + - action_cursor_left() +  value
  • - + - action_cursor_left_word() +  placeholder
  • - + - action_cursor_right() +  validators
  • - + - action_cursor_right_word() +  validate_on
  • - + - action_delete_left() +  valid_empty
  • - + - action_delete_left_all() +  name
  • - + - action_delete_left_word() +  id
  • - + - action_delete_right() +  classes
  • - + - action_delete_right_word() +  disabled
  • - + - action_home() +  tooltip
  • - + - clear() +  template
  • - + - insert_text_at_cursor() +  action_cursor_left
  • - + - validate() +  action_cursor_left_word
  • - + - validate_value() +  action_cursor_right + + + +
  • + +
  • + + +  action_cursor_right_word + + + +
  • + +
  • + + +  action_delete_left + + + +
  • + +
  • + + +  action_delete_left_all + + + +
  • + +
  • + + +  action_delete_left_word + + + +
  • + +
  • + + +  action_delete_right + + + +
  • + +
  • + + +  action_delete_right_word + + + +
  • + +
  • + + +  action_home + + + +
  • + +
  • + + +  clear + + + +
  • + +
  • + + +  insert_text_at_cursor + + + + + +
  • + +
  • + + +  validate + + + +
  • + +
  • + + +  validate_value @@ -6677,142 +6791,256 @@
  • - textual.widgets.MaskedInput +  MaskedInput + + + +
  • + +
  • + + +  template + + + +
  • + +
  • + + +  value + + + +
  • + +
  • + + +  placeholder + + + +
  • + +
  • + + +  validators + + + +
  • + +
  • + + +  validate_on + + + +
  • + +
  • + + +  valid_empty + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  tooltip
  • - + - template +  template
  • - + - action_cursor_left() +  action_cursor_left
  • - + - action_cursor_left_word() +  action_cursor_left_word
  • - + - action_cursor_right() +  action_cursor_right
  • - + - action_cursor_right_word() +  action_cursor_right_word
  • - + - action_delete_left() +  action_delete_left
  • - + - action_delete_left_all() +  action_delete_left_all
  • - + - action_delete_left_word() +  action_delete_left_word
  • - + - action_delete_right() +  action_delete_right
  • - + - action_delete_right_word() +  action_delete_right_word
  • - + - action_home() +  action_home
  • - + - clear() +  clear
  • - + + +  insert_text_at_cursor + + + + +
  • - + - validate() +  validate
  • - + - validate_value() +  validate_value @@ -7154,8 +7382,8 @@

    The template string formatMessages

    Bindings

    The masked input widget defines the following bindings:

    @@ -7165,9 +7393,11 @@

    Bindings - - + + +
    + +
    @@ -7229,7 +7459,7 @@

    BindingsComponent Classes

    The masked input widget provides the following component classes:

    @@ -7239,9 +7469,11 @@

    Bindings - -

    Key(s)
    + + +
    + +
    @@ -7263,7 +7495,7 @@

    BindingsBindings + -
    -

    - Bases: Input

    +
    +

    + Bases: Input

    - -

    A masked text input widget.

    - -

    Parameters:

    -

    Class
    - - - - - - - - - - - - - - - - - - - - - - - - - - - +

    A masked text input widget.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    template - str -

    Template string.

    - required -
    value - str | None -

    An optional default value for the input.

    - None -
    placeholder - str -

    Optional placeholder text for the input.

    - '' -
    + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    validators - Validator | Iterable[Validator] | None -

    An iterable of validators that the MaskedInput value will be checked against.

    - None - NameTypeDescriptionDefault
    validate_on - Iterable[InputValidationOn] | None -

    Zero or more of the values "blur", "changed", and "submitted", +

    +

    template +

    + str + +
    +

    Template string.

    +
    +
    + required +
    +

    value +

    + str | None + +
    +

    An optional default value for the input.

    +
    +
    + None +
    +

    placeholder +

    + str + +
    +

    Optional placeholder text for the input.

    +
    +
    + '' +
    +

    validators +

    + Validator | Iterable[Validator] | None + +
    +

    An iterable of validators that the MaskedInput value will be checked against.

    +
    +
    + None +
    +

    validate_on +

    + Iterable[InputValidationOn] | None + +
    +

    Zero or more of the values "blur", "changed", and "submitted", which determine when to do input validation. The default is to do -validation for all messages.

    - None -
    valid_empty - bool -

    Empty values are valid.

    - False -
    name - str | None -

    Optional name for the masked input widget.

    - None -
    id - str | None -

    Optional ID for the widget.

    - None -
    classes - str | None -

    Optional initial classes for the widget.

    - None -
    disabled - bool -

    Whether the input is disabled or not.

    - False -
    tooltip - RenderableType | None -

    Optional tooltip.

    - None -
    +validation for all messages.

    +

  • + + + None + + + + +

    valid_empty +

    + + bool + + +
    +

    Empty values are valid.

    +
    + + + False + + + + +

    name +

    + + str | None + + +
    +

    Optional name for the masked input widget.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    Optional ID for the widget.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    Optional initial classes for the widget.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    Whether the input is disabled or not.

    +
    + + + False + + + + +

    tooltip +

    + + RenderableType | None + + +
    +

    Optional tooltip.

    +
    + + + None + + + + + + + + + + -
    @@ -7422,23 +7727,23 @@

    Bindings - template +

    + template + - - instance-attribute class-attribute + instance-attribute -

    -
    template = template
    +

    +
    template = template
     
    -
    - -

    Input template mask currently in use.

    -
    +
    + +

    Input template mask currently in use.

    +
    @@ -7447,330 +7752,328 @@

    - -

    - action_cursor_left +

    + action_cursor_left -

    -
    action_cursor_left()
    +
    +
    action_cursor_left()
     
    -
    - -

    Move the cursor one position to the left; separators are skipped.

    +
    -
    +

    Move the cursor one position to the left; separators are skipped.

    + +
    - -

    - action_cursor_left_word +

    + action_cursor_left_word -

    -
    action_cursor_left_word()
    +
    +
    action_cursor_left_word()
     
    -
    - -

    Move the cursor left next to the previous separator. If no previous +

    + +

    Move the cursor left next to the previous separator. If no previous separator is found, moves the cursor to the start of the input.

    -
    +
    - -

    - action_cursor_right +

    + action_cursor_right -

    -
    action_cursor_right()
    +
    +
    action_cursor_right()
     
    -
    - -

    Move the cursor one position to the right; separators are skipped.

    +
    -
    +

    Move the cursor one position to the right; separators are skipped.

    + +
    - -

    - action_cursor_right_word +

    + action_cursor_right_word -

    -
    action_cursor_right_word()
    +
    +
    action_cursor_right_word()
     
    -
    - -

    Move the cursor right next to the next separator. If no next +

    + +

    Move the cursor right next to the next separator. If no next separator is found, moves the cursor to the end of the input.

    -
    +
    - -

    - action_delete_left +

    + action_delete_left -

    -
    action_delete_left()
    +
    +
    action_delete_left()
     
    -
    - -

    Delete one character to the left of the current cursor position.

    +
    -
    +

    Delete one character to the left of the current cursor position.

    + +
    - -

    - action_delete_left_all +

    + action_delete_left_all -

    -
    action_delete_left_all()
    +
    +
    action_delete_left_all()
     
    -
    - -

    Delete all characters to the left of the cursor position.

    +
    -
    +

    Delete all characters to the left of the cursor position.

    + +
    - -

    - action_delete_left_word +

    + action_delete_left_word -

    -
    action_delete_left_word()
    +
    +
    action_delete_left_word()
     
    -
    - -

    Delete leftward of the cursor position to the previous separator or +

    + +

    Delete leftward of the cursor position to the previous separator or the start of the input.

    -
    +
    - -

    - action_delete_right +

    + action_delete_right -

    -
    action_delete_right()
    +
    +
    action_delete_right()
     
    -
    - -

    Delete one character at the current cursor position.

    +
    -
    +

    Delete one character at the current cursor position.

    + +
    - -

    - action_delete_right_word +

    + action_delete_right_word -

    -
    action_delete_right_word()
    +
    +
    action_delete_right_word()
     
    -
    - -

    Delete the current character and all rightward to next separator or +

    + +

    Delete the current character and all rightward to next separator or the end of the input.

    -
    +
    - -

    - action_home +

    + action_home -

    -
    action_home()
    +
    +
    action_home()
     
    -
    - -

    Move the cursor to the start of the input.

    +
    -
    +

    Move the cursor to the start of the input.

    + +
    - -

    - clear +

    + clear -

    -
    clear()
    +
    +
    clear()
     
    -
    - -

    Clear the masked input.

    +
    -
    +

    Clear the masked input.

    + +
    - -

    - insert_text_at_cursor +

    + insert_text_at_cursor -

    -
    insert_text_at_cursor(text)
    +
    +
    insert_text_at_cursor(text)
     
    -
    - -

    Insert new text at the cursor, move the cursor to the end of the new text.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Insert new text at the cursor, move the cursor to the end of the new text.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    text - str -

    New text to insert.

    - required - NameTypeDescriptionDefault
    + + + + +

    text +

    + + str + + +
    +

    New text to insert.

    +
    + + + required + + + + -
    +
    - -

    - validate +

    + validate -

    -
    validate(value)
    +
    +
    validate(value)
     
    -
    - -

    Run all the validators associated with this MaskedInput on the supplied value.

    +
    + +

    Run all the validators associated with this MaskedInput on the supplied value.

    Same as Input.validate() but also validates against template which acts as an additional implicit validator.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - ValidationResult | None -

    A ValidationResult indicating whether all validators succeeded or not. -That is, if any validator fails, the result will be an unsuccessful -validation.

    TypeDescription
    + + + + + ValidationResult | None + + +
    +

    A ValidationResult indicating whether all validators succeeded or not. +That is, if any validator fails, the result will be an unsuccessful +validation.

    +
    + + + + -
    +
    +

    + validate_value -

    - validate_value - -

    -
    validate_value(value)
    +
    +
    validate_value(value)
     
    -
    - -

    Validates value against template.

    +
    -
    +

    Validates value against template.

    + +
    @@ -7778,7 +8081,7 @@

    - textual.widgets.OptionList +  OptionList
  • - + - BINDINGS +  BINDINGS
  • - + - COMPONENT_CLASSES +  COMPONENT_CLASSES
  • - + - highlighted +  highlighted
  • - + - option_count +  option_count
  • - + - OptionHighlighted +  OptionHighlighted + +
  • - + - OptionMessage +  OptionMessage -
  • +
    -

    - OptionMessage +

    + OptionMessage -

    -
    OptionMessage(option_list, index)
    +
    +
    OptionMessage(option_list, index)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Base class for all option messages.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +

    Base class for all option messages.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    option_list - OptionList -

    The option list that owns the option.

    - required -
    + - - - - + + + + - -
    index - int -

    The index of the option that the message relates to.

    - required - NameTypeDescriptionDefault
    + + + + +

    option_list +

    + + OptionList + + +
    +

    The option list that owns the option.

    +
    + + + required + + + + +

    index +

    + + int + + +
    +

    The index of the option that the message relates to.

    +
    + + + required + + + + + + + + + + -
    @@ -8514,24 +9222,24 @@

    - control +

    + control + - property -

    -
    control: OptionList
    +
    +
    control
     
    -
    - -

    The option list that sent the message.

    -

    This is an alias for OptionMessage.option_list +

    + +

    The option list that sent the message.

    +

    This is an alias for OptionMessage.option_list and is used by the on decorator.

    -
    +
    @@ -8539,22 +9247,22 @@

    - option +

    + option + - instance-attribute -

    -
    option: Option = option_list.get_option_at_index(index)
    +
    +
    option = get_option_at_index(index)
     
    -
    - -

    The highlighted option.

    -
    +
    + +

    The highlighted option.

    +
    @@ -8562,22 +9270,22 @@

    - option_id +

    + option_id + - instance-attribute -

    -
    option_id: str | None = self.option.id
    +
    +
    option_id = id
     
    -
    - -

    The ID of the option that the message relates to.

    -
    +
    + +

    The ID of the option that the message relates to.

    +
    @@ -8585,22 +9293,22 @@

    - option_index +

    + option_index + - instance-attribute -

    -
    option_index: int = index
    +
    +
    option_index = index
     
    -
    - -

    The index of the option that the message relates to.

    -
    +
    + +

    The index of the option that the message relates to.

    +
    @@ -8608,22 +9316,22 @@

    - option_list +

    + option_list + - instance-attribute -

    -
    option_list: OptionList = option_list
    +
    +
    option_list = option_list
     
    -
    - -

    The option list that sent the message.

    -
    +
    + +

    The option list that sent the message.

    +
    @@ -8633,7 +9341,7 @@

    -

    +
    @@ -8641,327 +9349,423 @@

    - OptionSelected +

    + OptionSelected -

    + +
    OptionSelected(option_list, index)
    +
    +
    +

    + Bases: OptionMessage

    -
    -

    - Bases: OptionMessage

    - -

    Message sent when an option is selected.

    + +

    Message sent when an option is selected.

    Can be handled using on_option_list_option_selected in a subclass of OptionList or in a parent node in the DOM.

    +

    Parameters:

    + + + + + + + + + + + + + + + + + + + + + + + +
    NameTypeDescriptionDefault
    +

    option_list +

    + OptionList + +
    +

    The option list that owns the option.

    +
    +
    + required +
    +

    index +

    + int + +
    +

    The index of the option that the message relates to.

    +
    +
    + required +
    + + + + + + + + + +
    + + + + + + + + + + +
    +
    +
    +

    + action_cursor_down -

    - action_cursor_down - -

    -
    action_cursor_down()
    +
    +
    action_cursor_down()
     
    -
    - -

    Move the highlight down to the next enabled option.

    +
    -
    +

    Move the highlight down to the next enabled option.

    + +
    - -

    - action_cursor_up +

    + action_cursor_up -

    -
    action_cursor_up()
    +
    +
    action_cursor_up()
     
    -
    - -

    Move the highlight up to the previous enabled option.

    +
    -
    +

    Move the highlight up to the previous enabled option.

    + +
    +

    + action_first -

    - action_first - -

    -
    action_first()
    +
    +
    action_first()
     
    -
    - -

    Move the highlight to the first enabled option.

    +
    -
    +

    Move the highlight to the first enabled option.

    + +
    +

    + action_last -

    - action_last - -

    -
    action_last()
    +
    +
    action_last()
     
    -
    - -

    Move the highlight to the last enabled option.

    +
    -
    +

    Move the highlight to the last enabled option.

    + +
    +

    + action_page_down -

    - action_page_down - -

    -
    action_page_down()
    +
    +
    action_page_down()
     
    -
    - -

    Move the highlight down roughly by one page.

    +
    -
    +

    Move the highlight down roughly by one page.

    + +
    - -

    - action_page_up +

    + action_page_up -

    -
    action_page_up()
    +
    +
    action_page_up()
     
    -
    - -

    Move the highlight up roughly by one page.

    +
    -
    +

    Move the highlight up roughly by one page.

    + +
    - -

    - action_select +

    + action_select -

    -
    action_select()
    +
    +
    action_select()
     
    -
    - -

    Select the currently-highlighted option.

    +
    + +

    Select the currently-highlighted option.

    If no option is selected, then nothing happens. If an option is -selected, a OptionList.OptionSelected +selected, a OptionList.OptionSelected message will be posted.

    -
    +
    - -

    - add_option +

    + add_option -

    -
    add_option(item=None)
    +
    +
    add_option(item=None)
     
    -
    - -

    Add a new option to the end of the option list.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Add a new option to the end of the option list.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    item - NewOptionListContent -

    The new item to add.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    item +

    + NewOptionListContent + +
    +

    The new item to add.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - DuplicateID -

    If there is an attempt to use a duplicate ID.

    TypeDescription
    + + + + + DuplicateID + + +
    +

    If there is an attempt to use a duplicate ID.

    +
    + + + + -
    +
    - -

    - add_options +

    + add_options -

    -
    add_options(items)
    +
    +
    add_options(items)
     
    -
    - -

    Add new options to the end of the option list.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Add new options to the end of the option list.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    items - Iterable[NewOptionListContent] -

    The new items to add.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    items +

    + Iterable[NewOptionListContent] + +
    +

    The new items to add.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - DuplicateID -

    If there is an attempt to use a duplicate ID.

    TypeDescription
    + + + + + DuplicateID + + +
    +

    If there is an attempt to use a duplicate ID.

    +
    + + + + +
    Note @@ -8969,981 +9773,1163 @@

    +

    + clear_options -

    - clear_options - -

    -
    clear_options()
    +
    +
    clear_options()
     
    -
    - -

    Clear the content of the option list.

    +
    + +

    Clear the content of the option list.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    + + + + + Self + + +
    +

    The OptionList instance.

    +
    + + + + -
    +
    - -

    - disable_option +

    + disable_option -

    -
    disable_option(option_id)
    +
    +
    disable_option(option_id)
     
    -
    - -

    Disable the option with the given ID.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Disable the option with the given ID.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    option_id - str -

    The ID of the option to disable.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    option_id +

    + str + +
    +

    The ID of the option to disable.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If no option has the given ID.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If no option has the given ID.

    +
    + + + + -
    +
    +

    + disable_option_at_index -

    - disable_option_at_index - -

    -
    disable_option_at_index(index)
    +
    +
    disable_option_at_index(index)
     
    -
    - -

    Disable the option at the given index.

    +
    -

    Returns:

    - - - - - - - - +

    Disable the option at the given index.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If there is no option with the given index.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If there is no option with the given index.

    +
    + + + + -
    +
    - -

    - enable_option +

    + enable_option -

    -
    enable_option(option_id)
    +
    +
    enable_option(option_id)
     
    -
    - -

    Enable the option with the given ID.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Enable the option with the given ID.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    option_id - str -

    The ID of the option to enable.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    option_id +

    + str + +
    +

    The ID of the option to enable.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If no option has the given ID.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If no option has the given ID.

    +
    + + + + -
    +
    +

    + enable_option_at_index -

    - enable_option_at_index - -

    -
    enable_option_at_index(index)
    +
    +
    enable_option_at_index(index)
     
    -
    - -

    Enable the option at the given index.

    +
    -

    Returns:

    - - - - - - - - +

    Enable the option at the given index.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If there is no option with the given index.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If there is no option with the given index.

    +
    + + + + -
    +
    - -

    - get_option +

    + get_option -

    -
    get_option(option_id)
    +
    +
    get_option(option_id)
     
    -
    - -

    Get the option with the given ID.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the option with the given ID.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    option_id - str -

    The ID of the option to get.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    option_id +

    + str + +
    +

    The ID of the option to get.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Option -

    The option with the ID.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Option + +
    +

    The option with the ID.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If no option has the given ID.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If no option has the given ID.

    +
    + + + + -
    +
    - -

    - get_option_at_index +

    + get_option_at_index -

    -
    get_option_at_index(index)
    +
    +
    get_option_at_index(index)
     
    -
    - -

    Get the option at the given index.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the option at the given index.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    index - int -

    The index of the option to get.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    index +

    + int + +
    +

    The index of the option to get.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Option -

    The option at that index.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Option + +
    +

    The option at that index.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If there is no option with the given index.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If there is no option with the given index.

    +
    + + + + -
    +
    +

    + get_option_index -

    - get_option_index - -

    -
    get_option_index(option_id)
    +
    +
    get_option_index(option_id)
     
    -
    - -

    Get the index of the option with the given ID.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Get the index of the option with the given ID.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    option_id - str -

    The ID of the option to get the index of.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    option_id +

    + str + +
    +

    The ID of the option to get the index of.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - int -

    The index of the item with the given ID.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + int + +
    +

    The index of the item with the given ID.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If no option has the given ID.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If no option has the given ID.

    +
    + + + + -
    +
    +

    + remove_option -

    - remove_option - -

    -
    remove_option(option_id)
    +
    +
    remove_option(option_id)
     
    -
    - -

    Remove the option with the given ID.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Remove the option with the given ID.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    option_id - str -

    The ID of the option to remove.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    option_id +

    + str + +
    +

    The ID of the option to remove.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If no option has the given ID.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If no option has the given ID.

    +
    + + + + -
    +
    - -

    - remove_option_at_index +

    + remove_option_at_index -

    -
    remove_option_at_index(index)
    +
    +
    remove_option_at_index(index)
     
    -
    - -

    Remove the option at the given index.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Remove the option at the given index.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    index - int -

    The index of the option to remove.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    index +

    + int + +
    +

    The index of the option to remove.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If there is no option with the given index.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If there is no option with the given index.

    +
    + + + + -
    +
    - -

    - replace_option_prompt +

    + replace_option_prompt -

    -
    replace_option_prompt(option_id, prompt)
    +
    +
    replace_option_prompt(option_id, prompt)
     
    -
    - -

    Replace the prompt of the option with the given ID.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Replace the prompt of the option with the given ID.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    option_id - str -

    The ID of the option to replace the prompt of.

    - required -
    + - - - - + + + + - -
    prompt - RenderableType -

    The new prompt for the option.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    option_id +

    + str + +
    +

    The ID of the option to replace the prompt of.

    +
    +
    + required +
    +

    prompt +

    + RenderableType + +
    +

    The new prompt for the option.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If no option has the given ID.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If no option has the given ID.

    +
    + + + + -
    +
    - -

    - replace_option_prompt_at_index +

    + replace_option_prompt_at_index -

    -
    replace_option_prompt_at_index(index, prompt)
    +
    +
    replace_option_prompt_at_index(index, prompt)
     
    -
    - -

    Replace the prompt of the option at the given index.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - +
    + +

    Replace the prompt of the option at the given index.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    index - int -

    The index of the option to replace the prompt of.

    - required -
    + - - - - + + + + - -
    prompt - RenderableType -

    The new prompt for the option.

    - required - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + +
    TypeDescription
    +

    index +

    + int + +
    +

    The index of the option to replace the prompt of.

    +
    +
    + required +
    +

    prompt +

    + RenderableType + +
    +

    The new prompt for the option.

    +
    +
    + required +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The OptionList instance.

    TypeDescription
    - -

    Raises:

    - - - - - - - - + + + + + + + +
    TypeDescription
    + Self + +
    +

    The OptionList instance.

    +
    +
    + + +

    Raises:

    + + - - + + - -
    - OptionDoesNotExist -

    If there is no option with the given index.

    TypeDescription
    + + + + + OptionDoesNotExist + + +
    +

    If there is no option with the given index.

    +
    + + + + -
    +
    - -

    - scroll_to_highlight +

    + scroll_to_highlight -

    -
    scroll_to_highlight(top=False)
    +
    +
    scroll_to_highlight(top=False)
     
    -
    - -

    Ensure that the highlighted option is in view.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Ensure that the highlighted option is in view.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    top - bool -

    Scroll highlight to top of the list.

    - False - NameTypeDescriptionDefault
    + + + + +

    top +

    + + bool + + +
    +

    Scroll highlight to top of the list.

    +
    + + + False + + + + -
    +
    - -

    - validate_highlighted +

    + validate_highlighted -

    -
    validate_highlighted(highlighted)
    +
    +
    validate_highlighted(highlighted)
     
    -
    - -

    Validate the highlighted property value on access.

    +
    -
    +

    Validate the highlighted property value on access.

    + +
    +

    + watch_highlighted -

    - watch_highlighted - -

    -
    watch_highlighted(highlighted)
    +
    +
    watch_highlighted(highlighted)
     
    -
    - -

    React to the highlighted option having changed.

    +
    -
    +

    React to the highlighted option having changed.

    + +
    @@ -9951,17 +10937,23 @@

    + -
    +
    + + + + + + -
    @@ -9977,22 +10969,27 @@

    - DuplicateID + DuplicateID

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Raised if a duplicate ID is used when adding options to an option list.

    +

    Raised if a duplicate ID is used when adding options to an option list.

    -
    + + + + + + +
    @@ -10001,66 +10998,90 @@

    - Option + Option

    -
    Option(prompt, id=None, disabled=False)
    +
    Option(prompt, id=None, disabled=False)
     
    -
    +
    - -

    Class that holds the details of an individual option.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +

    Class that holds the details of an individual option.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    prompt - RenderableType -

    The prompt for the option.

    - required -
    id - str | None -

    The optional ID for the option.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    The initial enabled/disabled state. Enabled by default.

    - False - NameTypeDescriptionDefault
    + + + + +

    prompt +

    + + RenderableType + + +
    +

    The prompt for the option.

    +
    + + + required + + + + +

    id +

    + + str | None + + +
    +

    The optional ID for the option.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    The initial enabled/disabled state. Enabled by default.

    +
    + + + False + + + + + + + + + + -
    @@ -10074,22 +11095,22 @@

    -

    - id +

    + id + - property -

    -
    id: str | None
    +

    +
    id
     
    -
    - -

    The optional ID for the option.

    -
    +
    + +

    The optional ID for the option.

    +
    @@ -10097,22 +11118,22 @@

    -

    - prompt +

    + prompt + - property -

    -
    prompt: RenderableType
    +
    +
    prompt
     
    -
    - -

    The prompt for the option.

    -
    +
    + +

    The prompt for the option.

    +
    @@ -10121,44 +11142,50 @@

    - -

    - set_prompt +

    + set_prompt -

    -
    set_prompt(prompt)
    +

    +
    set_prompt(prompt)
     
    -
    - -

    Set the prompt for the option.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Set the prompt for the option.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    prompt - RenderableType -

    The new prompt for the option.

    - required - NameTypeDescriptionDefault
    + + + + +

    prompt +

    + + RenderableType + + +
    +

    The new prompt for the option.

    +
    + + + required + + + + -
    +
    @@ -10166,7 +11193,7 @@

    -
    +
    @@ -10175,22 +11202,27 @@

    - OptionDoesNotExist + OptionDoesNotExist

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    + + + +

    Raised when a request has been made for an option that doesn't exist.

    + + - -

    Raised when a request has been made for an option that doesn't exist.

    -
    + +
    @@ -10199,20 +11231,25 @@

    - Separator + Separator

    -
    +
    + + + +

    Class used to add a separator to an OptionList.

    - -

    Class used to add a separator to an OptionList.

    -
    + + + +
    @@ -10221,7 +11258,7 @@

    -
    +
    diff --git a/widgets/placeholder/index.html b/widgets/placeholder/index.html index 58dd0a7d40..ff954ee97f 100644 --- a/widgets/placeholder/index.html +++ b/widgets/placeholder/index.html @@ -4518,34 +4518,88 @@
  • - textual.widgets.Placeholder +  Placeholder
  • - + - variant +  label
  • - + - cycle_variant() +  variant
  • - + - validate_variant() +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  variant + + + +
  • + +
  • + + +  cycle_variant + + + +
  • + +
  • + + +  validate_variant @@ -6539,34 +6593,88 @@
  • - textual.widgets.Placeholder +  Placeholder + + + +
  • + +
  • + + +  label + + + +
  • + +
  • + + +  variant
  • - + - variant +  name
  • - + - cycle_variant() +  id
  • - + - validate_variant() +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  variant + + + +
  • + +
  • + + +  cycle_variant + + + +
  • + +
  • + + +  validate_variant @@ -6898,13 +7006,15 @@

    Component Classes + -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    A simple placeholder widget to use before you build your custom widgets.

    + + +

    A simple placeholder widget to use before you build your custom widgets.

    This placeholder has a couple of variants that show different data. Clicking the placeholder cycles through the available variants, but a placeholder can also be initialised in a specific variant.

    @@ -6932,86 +7042,127 @@

    Component Classesstr | None - -

    The label to identify the placeholder. -If no label is present, uses the placeholder ID instead.

    - - None - - - - variant - - PlaceholderVariant - -

    The variant of the placeholder.

    - - 'default' - - - - name - - str | None - -

    The name of the placeholder.

    - - None - - - - id - - str | None - -

    The ID of the placeholder in the DOM.

    - - None - - - - classes - - str | None - -

    A space separated string with the CSS classes -of the placeholder, if any.

    - - None - - + +

    Parameters:

    + + - - - - + + + + - -
    disabled - bool -

    Whether the placeholder is disabled or not.

    - False - NameTypeDescriptionDefault
    + + + + +

    label +

    + + str | None + + +
    +

    The label to identify the placeholder. +If no label is present, uses the placeholder ID instead.

    +
    + + + None + + + + +

    variant +

    + + PlaceholderVariant + + +
    +

    The variant of the placeholder.

    +
    + + + 'default' + + + + +

    name +

    + + str | None + + +
    +

    The name of the placeholder.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    The ID of the placeholder in the DOM.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    A space separated string with the CSS classes +of the placeholder, if any.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    Whether the placeholder is disabled or not.

    +
    + + + False + + + + + + + + + + -
    @@ -7025,25 +7176,23 @@

    Component Classes - variant +

    + variant + - - instance-attribute class-attribute + instance-attribute -

    -
    variant: Reactive[PlaceholderVariant] = (
    -    self.validate_variant(variant)
    -)
    +

    +
    variant = validate_variant(variant)
     
    -
    - -

    The current variant of the placeholder.

    -
    +
    + +

    The current variant of the placeholder.

    +
    @@ -7052,58 +7201,61 @@

    +

    + cycle_variant -

    - cycle_variant - -

    -
    cycle_variant()
    +

    +
    cycle_variant()
     
    -
    - -

    Get the next variant in the cycle.

    +
    -

    Returns:

    - - - - - - - - +

    Get the next variant in the cycle.

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The Placeholder instance.

    TypeDescription
    + + + + + Self + + +
    +

    The Placeholder instance.

    +
    + + + + -
    +
  • - -

    - validate_variant +

    + validate_variant -

    -
    validate_variant(variant)
    +
    +
    validate_variant(variant)
     
    -
    - -

    Validate the variant to which the placeholder was set.

    +
    -
    +

    Validate the variant to which the placeholder was set.

    + +
    @@ -7111,7 +7263,7 @@

    - textual.widgets.Pretty +  Pretty
  • - + - update() +  object +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  update + + + + +
  • @@ -6521,19 +6572,70 @@
  • - textual.widgets.Pretty +  Pretty + + + +
  • + +
  • + + +  object + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id
  • - + + +  classes + + + +
  • + +
  • + + +  update + + + + +
  • @@ -6763,73 +6865,104 @@

    Component Classes + -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    A pretty-printing widget.

    + + +

    A pretty-printing widget.

    Used to pretty-print any object.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    object - Any -

    The object to pretty-print.

    - required -
    name - str | None -

    The name of the pretty widget.

    - None -
    id - str | None -

    The ID of the pretty in the DOM.

    - None -
    + - - - - + + + + - -
    classes - str | None -

    The CSS classes of the pretty.

    - None - NameTypeDescriptionDefault
    + + + + +

    object +

    + + Any + + +
    +

    The object to pretty-print.

    +
    + + + required + + + + +

    name +

    + + str | None + + +
    +

    The name of the pretty widget.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    The ID of the pretty in the DOM.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    The CSS classes of the pretty.

    +
    + + + None + + + + + + + + + + -
    @@ -6844,44 +6977,50 @@

    Component Classes +

    + update -

    - update - -

    -
    update(object)
    +

    +
    update(object)
     
    -
    - -

    Update the content of the pretty widget.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Update the content of the pretty widget.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    object - Any -

    The object to pretty-print.

    - required - NameTypeDescriptionDefault
    + + + + +

    object +

    + + Any + + +
    +

    The object to pretty-print.

    +
    + + + required + + + + -
    +
    @@ -6889,7 +7028,7 @@

    -

    +
    diff --git a/widgets/progress_bar/index.html b/widgets/progress_bar/index.html index 4a5bcaa11d..c280f07e44 100644 --- a/widgets/progress_bar/index.html +++ b/widgets/progress_bar/index.html @@ -4626,64 +4626,202 @@
  • - textual.widgets.ProgressBar +  ProgressBar
  • - + - gradient +  total
  • - + - percentage +  show_bar
  • - + - progress +  show_percentage
  • - + - total +  show_eta
  • - + - advance() +  name
  • - + - update() +  id +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  clock + + + +
  • + +
  • + + +  gradient + + + +
  • + +
  • + + +  gradient + + + +
  • + +
  • + + +  percentage + + + +
  • + +
  • + + +  progress + + + +
  • + +
  • + + +  total + + + +
  • + +
  • + + +  advance + + + + + +
  • + +
  • + + +  update + + + + +
  • @@ -6698,64 +6836,202 @@
  • - textual.widgets.ProgressBar +  ProgressBar + + + +
  • + +
  • + + +  total + + + +
  • + +
  • + + +  show_bar + + + +
  • + +
  • + + +  show_percentage + + + +
  • + +
  • + + +  show_eta + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id
  • - + - gradient +  classes
  • - + - percentage +  disabled
  • - + - progress +  clock
  • - + - total +  gradient
  • - + - advance() +  gradient
  • - + - update() +  percentage +
  • + +
  • + + +  progress + + + +
  • + +
  • + + +  total + + + +
  • + +
  • + + +  advance + + + + + +
  • + +
  • + + +  update + + + + +
  • @@ -8685,9 +8961,11 @@

    Bar Component Classes - -

    The bar sub-widget provides the component classes that follow.

    + + +
    + +

    The bar sub-widget provides the component classes that follow.

    These component classes let you modify the foreground and background color of the bar in its different states.

    @@ -8712,7 +8990,7 @@

    Bar Component ClassesReactive Attributes

    @@ -8757,16 +9035,18 @@

    Component Classes + -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    A progress bar widget.

    - -

    The progress bar uses "steps" as the measurement unit.

    + +

    A progress bar widget.

    + +

    The progress bar uses "steps" as the measurement unit.

    +
    Example @@ -8778,122 +9058,188 @@

    Component Classes self.query_one(ProgressBar).advance(5)

    -

    Parameters:

    -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    total - float | None -

    The total number of steps in the progress if known.

    - None -
    show_bar - bool -

    Whether to show the bar portion of the progress bar.

    - True -
    show_percentage - bool -

    Whether to show the percentage status of the bar.

    - True -
    show_eta - bool -

    Whether to show the ETA countdown of the progress bar.

    - True -
    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 -
    clock - Clock | None -

    An optional clock object (leave as default unless testing).

    - None -
    + - - - - + + + + - -
    gradient - Gradient | None -

    An optional Gradient object (will replace CSS styles in the bar).

    - None - NameTypeDescriptionDefault
    + + + + +

    total +

    + + float | None + + +
    +

    The total number of steps in the progress if known.

    +
    + + + None + + + + +

    show_bar +

    + + bool + + +
    +

    Whether to show the bar portion of the progress bar.

    +
    + + + True + + + + +

    show_percentage +

    + + bool + + +
    +

    Whether to show the percentage status of the bar.

    +
    + + + True + + + + +

    show_eta +

    + + bool + + +
    +

    Whether to show the ETA countdown of the progress bar.

    +
    + + + True + + + + +

    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 + + + + +

    clock +

    + + Clock | None + + +
    +

    An optional clock object (leave as default unless testing).

    +
    + + + None + + + + +

    gradient +

    + + Gradient | None + + +
    +

    An optional Gradient object (will replace CSS styles in the bar).

    +
    + + + None + + + + + + + + + + -
    @@ -8907,23 +9253,23 @@

    Component Classes - gradient +

    + gradient + - - instance-attribute class-attribute + instance-attribute -

    -
    gradient: reactive[Gradient | None] = reactive(None)
    +

    +
    gradient = reactive(None)
     
    -
    - -

    Optional gradient object (will replace CSS styling in bar).

    -
    +
    + +

    Optional gradient object (will replace CSS styling in bar).

    +
    @@ -8931,27 +9277,26 @@

    - percentage +

    + percentage + - - instance-attribute class-attribute + instance-attribute -

    -
    percentage: reactive[float | None] = reactive[
    -    Optional[float]
    -](None)
    +

    +
    percentage = reactive[Optional[float]](None)
     
    -
    - -

    The percentage of progress that has been completed.

    +
    + +

    The percentage of progress that has been completed.

    The percentage is a value between 0 and 1 and the returned value is only None if the total progress of the bar hasn't been set yet.

    +
    Example
    progress_bar = ProgressBar()
    @@ -8960,7 +9305,7 @@ 

    progress_bar.advance(50) print(progress_bar.percentage) # 0.5

    -
    +
    @@ -8968,23 +9313,23 @@

    - progress +

    + progress + - - instance-attribute class-attribute + instance-attribute -

    -
    progress: reactive[float] = reactive(0.0)
    +
    +
    progress = reactive(0.0)
     
    -
    - -

    The progress so far, in number of steps.

    -
    +
    + +

    The progress so far, in number of steps.

    +
    @@ -8992,24 +9337,24 @@

    - total +

    + total + - - instance-attribute class-attribute + instance-attribute -

    -
    total: reactive[float | None] = total
    +
    +
    total = total
     
    -
    - -

    The total number of steps associated with this progress bar, when known.

    +
    + +

    The total number of steps associated with this progress bar, when known.

    The value None will render an indeterminate progress bar.

    -
    +
    @@ -9018,67 +9363,74 @@

    +

    + advance -

    - advance - -

    -
    advance(advance=1)
    +
    +
    advance(advance=1)
     
    -
    - -

    Advance the progress of the progress bar by the given amount.

    +
    + +

    Advance the progress of the progress bar by the given amount.

    +
    Example
    progress_bar.advance(10)  # Advance 10 steps.
     
    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    advance - float -

    Number of steps to advance progress by.

    - 1 - NameTypeDescriptionDefault
    + + + + +

    advance +

    + + float + + +
    +

    Number of steps to advance progress by.

    +
    + + + 1 + + + + -
    +
    +

    + update -

    - update - -

    -
    update(*, total=UNUSED, progress=UNUSED, advance=UNUSED)
    +
    +
    update(*, total=UNUSED, progress=UNUSED, advance=UNUSED)
     
    -
    - -

    Update the progress bar with the given options.

    +
    + +

    Update the progress bar with the given options.

    +
    Example @@ -9088,51 +9440,70 @@

    )

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    total - None | float | UnusedParameter -

    New total number of steps.

    - UNUSED -
    progress - float | UnusedParameter -

    Set the progress to the given number of steps.

    - UNUSED -
    + - - - - + + + + - -
    advance - float | UnusedParameter -

    Advance the progress by this number of steps.

    - UNUSED - NameTypeDescriptionDefault
    + + + + +

    total +

    + + None | float | UnusedParameter + + +
    +

    New total number of steps.

    +
    + + + UNUSED + + + + +

    progress +

    + + float | UnusedParameter + + +
    +

    Set the progress to the given number of steps.

    +
    + + + UNUSED + + + + +

    advance +

    + + float | UnusedParameter + + +
    +

    Advance the progress by this number of steps.

    +
    + + + UNUSED + + + + -
    +
    @@ -9140,7 +9511,7 @@

    - textual.widgets.RadioButton +  RadioButton
  • - + - BUTTON_INNER +  label
  • - + - Changed +  value -
  • + +
  • + + +  button_first + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  tooltip + + + +
  • + +
  • + + +  BUTTON_INNER + + + +
  • + +
  • + + +  Changed + + + +
  • +
    control
     
    -
    - -

    Alias for Changed.radio_button.

    -
    +
    + +

    Alias for Changed.radio_button.

    +
    @@ -7051,22 +7440,22 @@

    - radio_button +

    + radio_button + - property -

    -
    radio_button: RadioButton
    +
    +
    radio_button
     
    -
    - -

    The radio button that was changed.

    -
    +
    + +

    The radio button that was changed.

    +
    @@ -7076,7 +7465,7 @@

    - textual.widgets.RadioSet +  RadioSet
  • - + - BINDINGS +  buttons
  • - + - pressed_button +  name
  • - + - pressed_index +  id
  • - + - Changed +  classes -
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  tooltip + + + +
  • + +
  • + + +  BINDINGS + + + +
  • + +
  • + + +  pressed_button + + + +
  • + +
  • + + +  pressed_index + + + +
  • + +
  • + + +  Changed + + + +
  • @@ -7498,22 +7670,22 @@

    -

    - pressed_button +

    + pressed_button + - property -

    -
    pressed_button: RadioButton | None
    +
    +
    pressed_button
     
    -
    - -

    The currently-pressed RadioButton, or None if none are pressed.

    -
    +
    + +

    The currently-pressed RadioButton, or None if none are pressed.

    +
    @@ -7521,22 +7693,22 @@

    - pressed_index +

    + pressed_index + - property -

    -
    pressed_index: int
    +
    +
    pressed_index
     
    -
    - -

    The index of the currently-pressed RadioButton, or -1 if none are pressed.

    -
    +
    + +

    The index of the currently-pressed RadioButton, or -1 if none are pressed.

    +
    @@ -7545,50 +7717,62 @@

    - Changed +

    + Changed -

    -
    Changed(radio_set, pressed)
    +
    +
    Changed(radio_set, pressed)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when the pressed button in the set changes.

    + + +

    Posted when the pressed button in the set changes.

    This message can be handled using an on_radio_set_changed method.

    - -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    pressed - RadioButton -

    The radio button that was pressed.

    - required - NameTypeDescriptionDefault
    + + + + +

    pressed +

    + + RadioButton + + +
    +

    The radio button that was pressed.

    +
    + + + required + + + + + + + + + + -
    @@ -7602,23 +7786,23 @@

    -

    - ALLOW_SELECTOR_MATCH +

    + ALLOW_SELECTOR_MATCH + - - instance-attribute class-attribute + instance-attribute -

    -
    ALLOW_SELECTOR_MATCH = {'pressed'}
    +
    +
    ALLOW_SELECTOR_MATCH = {'pressed'}
     
    -
    - -

    Additional message attributes that can be used with the on decorator.

    -
    +
    + +

    Additional message attributes that can be used with the on decorator.

    +
    @@ -7626,24 +7810,24 @@

    - control +

    + control + - property -

    -
    control: RadioSet
    +
    +
    control
     
    -
    - -

    A reference to the RadioSet that was changed.

    -

    This is an alias for Changed.radio_set +

    + +

    A reference to the RadioSet that was changed.

    +

    This is an alias for Changed.radio_set and is used by the on decorator.

    -
    +
    @@ -7651,22 +7835,22 @@

    - index +

    + index + - instance-attribute -

    -
    index = radio_set.pressed_index
    +
    +
    index = pressed_index
     
    -
    - -

    The index of the RadioButton that was pressed to make the change.

    -
    +
    + +

    The index of the RadioButton that was pressed to make the change.

    +
    @@ -7674,22 +7858,22 @@

    - pressed +

    + pressed + - instance-attribute -

    -
    pressed = pressed
    +
    +
    pressed = pressed
     
    -
    - -

    The RadioButton that was pressed to make the change.

    -
    +
    + +

    The RadioButton that was pressed to make the change.

    +
    @@ -7697,22 +7881,22 @@

    - radio_set +

    + radio_set + - instance-attribute -

    -
    radio_set = radio_set
    +
    +
    radio_set = radio_set
     
    -
    - -

    A reference to the RadioSet that was changed.

    -
    +
    + +

    A reference to the RadioSet that was changed.

    +
    @@ -7722,7 +7906,7 @@

    - -

    - action_next_button +

    + action_next_button -

    -
    action_next_button()
    +
    +
    action_next_button()
     
    -
    - -

    Navigate to the next button in the set.

    +
    + +

    Navigate to the next button in the set.

    Note that this will wrap around to the start if at the end.

    -
    +
    - -

    - action_previous_button +

    + action_previous_button -

    -
    action_previous_button()
    +
    +
    action_previous_button()
     
    -
    - -

    Navigate to the previous button in the set.

    +
    + +

    Navigate to the previous button in the set.

    Note that this will wrap around to the end if at the start.

    -
    +
    - -

    - action_toggle_button +

    + action_toggle_button -

    -
    action_toggle_button()
    +
    +
    action_toggle_button()
     
    -
    - -

    Toggle the state of the currently-selected button.

    +
    -
    +

    Toggle the state of the currently-selected button.

    + +
    @@ -7793,7 +7974,7 @@

    - textual.widgets.RichLog +  RichLog
  • - + - auto_scroll +  max_lines
  • - + - highlight +  min_width
  • - + - highlighter +  wrap
  • - + - lines +  highlight
  • - + - markup +  markup
  • - + - max_lines +  auto_scroll
  • - + - min_width +  name
  • - + - wrap +  id
  • - + - clear() +  classes
  • - + - write() +  disabled +
  • + +
  • + + +  auto_scroll + + + +
  • + +
  • + + +  highlight + + + +
  • + +
  • + + +  highlighter + + + +
  • + +
  • + + +  lines + + + +
  • + +
  • + + +  markup + + + +
  • + +
  • + + +  max_lines + + + +
  • + +
  • + + +  min_width + + + +
  • + +
  • + + +  wrap + + + +
  • + +
  • + + +  clear + + + +
  • + +
  • + + +  write + + + + +
  • @@ -6602,100 +6743,241 @@
  • - textual.widgets.RichLog +  RichLog + + + +
  • + +
  • + + +  max_lines + + + +
  • + +
  • + + +  min_width + + + +
  • + +
  • + + +  wrap + + + +
  • + +
  • + + +  highlight + + + +
  • + +
  • + + +  markup + + + +
  • + +
  • + + +  auto_scroll + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id
  • - + - auto_scroll +  classes
  • - + - highlight +  disabled
  • - + - highlighter +  auto_scroll
  • - + - lines +  highlight
  • - + - markup +  highlighter
  • - + - max_lines +  lines
  • - + - min_width +  markup
  • - + - wrap +  max_lines
  • - + - clear() +  min_width
  • - + - write() +  wrap +
  • + +
  • + + +  clear + + + +
  • + +
  • + + +  write + + + + +
  • @@ -6718,7 +7000,7 @@

    RichLog

    A RichLog is a widget which displays scrollable content that may be appended to in realtime.

    -

    Call RichLog.write with a string or Rich Renderable to write content to the end of the RichLog. Call RichLog.clear to clear the content.

    +

    Call RichLog.write with a string or Rich Renderable to write content to the end of the RichLog. Call RichLog.clear to clear the content.

    Tip

    See also Log which is an alternative to RichLog but specialized for simple text.

    @@ -7021,134 +7303,201 @@

    Component Classes + -
    -

    - Bases: ScrollView

    +
    +

    + Bases: ScrollView

    - -

    A widget for logging Rich renderables and text.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - +

    A widget for logging Rich renderables and text.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    max_lines - int | None -

    Maximum number of lines in the log or None for no maximum.

    - None -
    min_width - int -

    Width to use for calls to write with no specified width.

    - 78 -
    + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    wrap - bool -

    Enable word wrapping (default is off).

    - False - NameTypeDescriptionDefault
    highlight - bool -

    Automatically highlight content. By default, the ReprHighlighter is used. +

    +

    max_lines +

    + int | None + +
    +

    Maximum number of lines in the log or None for no maximum.

    +
    +
    + None +
    +

    min_width +

    + int + +
    +

    Width to use for calls to write with no specified width.

    +
    +
    + 78 +
    +

    wrap +

    + bool + +
    +

    Enable word wrapping (default is off).

    +
    +
    + False +
    +

    highlight +

    + bool + +
    +

    Automatically highlight content. By default, the ReprHighlighter is used. To customize highlighting, set highlight=True and then set the highlighter -attribute to an instance of Highlighter.

    - False -
    markup - bool -

    Apply Rich console markup.

    - False -
    auto_scroll - bool -

    Enable automatic scrolling to end.

    - True -
    name - str | None -

    The name of the text log.

    - None -
    id - str | None -

    The ID of the text log in the DOM.

    - None -
    classes - str | None -

    The CSS classes of the text log.

    - None -
    disabled - bool -

    Whether the text log is disabled or not.

    - False -
    +attribute to an instance of Highlighter.

    +
    + + + False + + + + +

    markup +

    + + bool + + +
    +

    Apply Rich console markup.

    +
    + + + False + + + + +

    auto_scroll +

    + + bool + + +
    +

    Enable automatic scrolling to end.

    +
    + + + True + + + + +

    name +

    + + str | None + + +
    +

    The name of the text log.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    The ID of the text log in the DOM.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    The CSS classes of the text log.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    Whether the text log is disabled or not.

    +
    + + + False + + + + + + + + + + -
    @@ -7162,23 +7511,23 @@

    Component Classes - auto_scroll +

    + auto_scroll + - - instance-attribute class-attribute + instance-attribute -

    -
    auto_scroll: var[bool] = auto_scroll
    +

    +
    auto_scroll = auto_scroll
     
    -
    - -

    Automatically scroll to the end on write.

    -
    +
    + +

    Automatically scroll to the end on write.

    +
    @@ -7186,23 +7535,23 @@

    -

    - highlight +

    + highlight + - - instance-attribute class-attribute + instance-attribute -

    -
    highlight: var[bool] = highlight
    +

    +
    highlight = highlight
     
    -
    - -

    Automatically highlight content.

    -
    +
    + +

    Automatically highlight content.

    +
    @@ -7210,22 +7559,22 @@

    -

    - highlighter +

    + highlighter + - instance-attribute -

    -
    highlighter: Highlighter = ReprHighlighter()
    +
    +
    highlighter = ReprHighlighter()
     
    -
    - -

    Rich Highlighter used to highlight content when highlight is True

    -
    +
    + +

    Rich Highlighter used to highlight content when highlight is True

    +
    @@ -7233,22 +7582,22 @@

    -

    - lines +

    + lines + - instance-attribute -

    -
    lines: list[Strip] = []
    +
    +
    lines = []
     
    -
    - -

    The lines currently visible in the log.

    -
    +
    + +

    The lines currently visible in the log.

    +
    @@ -7256,23 +7605,23 @@

    -

    - markup +

    + markup + - - instance-attribute class-attribute + instance-attribute -

    -
    markup: var[bool] = markup
    +
    +
    markup = markup
     
    -
    - -

    Apply Rich console markup.

    -
    +
    + +

    Apply Rich console markup.

    +
    @@ -7280,23 +7629,23 @@

    -

    - max_lines +

    + max_lines + - - instance-attribute class-attribute + instance-attribute -

    -
    max_lines: var[int | None] = max_lines
    +
    +
    max_lines = max_lines
     
    -
    - -

    Maximum number of lines in the log or None for no maximum.

    -
    +
    + +

    Maximum number of lines in the log or None for no maximum.

    +
    @@ -7304,23 +7653,23 @@

    -

    - min_width +

    + min_width + - - instance-attribute class-attribute + instance-attribute -

    -
    min_width: var[int] = min_width
    +
    +
    min_width = min_width
     
    -
    - -

    Minimum width of renderables.

    -
    +
    + +

    Minimum width of renderables.

    +
    @@ -7328,23 +7677,23 @@

    -

    - wrap +

    + wrap + - - instance-attribute class-attribute + instance-attribute -

    -
    wrap: var[bool] = wrap
    +
    +
    wrap = wrap
     
    -
    - -

    Enable word wrapping.

    -
    +
    + +

    Enable word wrapping.

    +
    @@ -7353,62 +7702,66 @@

    +

    + clear -

    - clear - -

    -
    clear()
    +

    +
    clear()
     
    -
    - -

    Clear the text log.

    +
    + +

    Clear the text log.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The RichLog instance.

    TypeDescription
    + + + + + Self + + +
    +

    The RichLog instance.

    +
    + + + + -
    +
    - -

    - write +

    + write -

    -
    write(
    -    content,
    -    width=None,
    -    expand=False,
    -    shrink=True,
    -    scroll_end=None,
    +
    +
    write(
    +    content,
    +    width=None,
    +    expand=False,
    +    shrink=True,
    +    scroll_end=None,
     )
     
    -
    - -

    Write a string or a Rich renderable to the bottom of the log.

    +
    + +

    Write a string or a Rich renderable to the bottom of the log.

    +
    Notes @@ -7416,92 +7769,128 @@

    This means if you call write in compose or on_mount, the content will not be rendered immediately.

    -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    content - RenderableType | object -

    Rich renderable (or a string).

    - required -
    width - int | None -

    Width to render, or None to use RichLog.min_width. -If specified, expand and shrink will be ignored.

    - None -
    expand - bool -

    Permit expanding of content to the width of the content region of the RichLog. -If width is specified, then expand will be ignored.

    - False -
    shrink - bool -

    Permit shrinking of content to fit within the content region of the RichLog. -If width is specified, then shrink will be ignored.

    - True -
    + - - - - + + + + - -
    scroll_end - bool | None -

    Enable automatic scroll to end, or None to use self.auto_scroll.

    - None - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    content +

    + RenderableType | object + +
    +

    Rich renderable (or a string).

    +
    +
    + required +
    +

    width +

    + int | None + +
    +

    Width to render, or None to use RichLog.min_width. +If specified, expand and shrink will be ignored.

    +
    +
    + None +
    +

    expand +

    + bool + +
    +

    Permit expanding of content to the width of the content region of the RichLog. +If width is specified, then expand will be ignored.

    +
    +
    + False +
    +

    shrink +

    + bool + +
    +

    Permit shrinking of content to fit within the content region of the RichLog. +If width is specified, then shrink will be ignored.

    +
    +
    + True +
    +

    scroll_end +

    + bool | None + +
    +

    Enable automatic scroll to end, or None to use self.auto_scroll.

    +
    +
    + None +
    + + +

    Returns:

    + + - - + + - -
    - Self -

    The RichLog instance.

    TypeDescription
    + + + + + Self + + +
    +

    The RichLog instance.

    +
    + + + + -
    +
    @@ -7509,7 +7898,7 @@

    -
    +
    diff --git a/widgets/rule/index.html b/widgets/rule/index.html index 905de69a7d..bdc0d7325b 100644 --- a/widgets/rule/index.html +++ b/widgets/rule/index.html @@ -4668,62 +4668,218 @@
  • - textual.widgets.Rule +  Rule
  • - + - line_style +  orientation
  • - + - orientation +  line_style
  • - + - horizontal() +  name
  • - + - vertical() +  id +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  line_style + + + +
  • + +
  • + + +  orientation + + + +
  • + +
  • + + +  horizontal + + + + + +
  • + +
  • + + +  vertical + + + + +
  • - rule +  rule -
  • @@ -7364,224 +7719,294 @@

    +

    + horizontal -

    - horizontal - classmethod -

    -
    horizontal(
    -    line_style="solid",
    -    name=None,
    -    id=None,
    -    classes=None,
    -    disabled=False,
    +

    +
    horizontal(
    +    line_style="solid",
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False,
     )
     
    -
    - -

    Utility constructor for creating a horizontal rule.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Utility constructor for creating a horizontal rule.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    line_style - LineStyle -

    The line style of the rule.

    - 'solid' -
    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 of the widget.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    Whether the widget is disabled or not.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    line_style +

    + LineStyle + +
    +

    The line style of the rule.

    +
    +
    + 'solid' +
    +

    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 of the widget.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the widget is disabled or not.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Rule -

    A rule widget with horizontal orientation.

    TypeDescription
    + + + + + Rule + + +
    +

    A rule widget with horizontal orientation.

    +
    + + + + -
    +
    +

    + vertical -

    - vertical - classmethod -

    -
    vertical(
    -    line_style="solid",
    -    name=None,
    -    id=None,
    -    classes=None,
    -    disabled=False,
    +
    +
    vertical(
    +    line_style="solid",
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False,
     )
     
    -
    - -

    Utility constructor for creating a vertical rule.

    - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    + +

    Utility constructor for creating a vertical rule.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    line_style - LineStyle -

    The line style of the rule.

    - 'solid' -
    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 of the widget.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    Whether the widget is disabled or not.

    - False - NameTypeDescriptionDefault
    - -

    Returns:

    - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    +

    line_style +

    + LineStyle + +
    +

    The line style of the rule.

    +
    +
    + 'solid' +
    +

    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 of the widget.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the widget is disabled or not.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Rule -

    A rule widget with vertical orientation.

    TypeDescription
    + + + + + Rule + + +
    +

    A rule widget with vertical orientation.

    +
    + + + + -
    +
    @@ -7589,7 +8014,7 @@

    -
    +
    @@ -7598,14 +8023,19 @@

    - textual.widgets.rule + textual.widgets.rule

    -
    +
    + + + + + + -
    @@ -7620,15 +8050,15 @@

    - LineStyle + LineStyle + - module-attribute

    -
    LineStyle = Literal[
    +
    LineStyle = Literal[
         "ascii",
         "blank",
         "dashed",
    @@ -7641,10 +8071,10 @@ 

    ]

    -
    - -

    The valid line styles of the rule widget.

    -
    +
    + +

    The valid line styles of the rule widget.

    +
    @@ -7653,21 +8083,21 @@

    - RuleOrientation + RuleOrientation + - module-attribute

    -
    RuleOrientation = Literal['horizontal', 'vertical']
    +
    RuleOrientation = Literal['horizontal', 'vertical']
     
    -
    - -

    The valid orientations of the rule widget.

    -
    +
    + +

    The valid orientations of the rule widget.

    +
    @@ -7677,22 +8107,27 @@

    - InvalidLineStyle + InvalidLineStyle

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Exception raised for an invalid rule line style.

    +

    Exception raised for an invalid rule line style.

    -
    + + + + + + +
    @@ -7701,22 +8136,27 @@

    - InvalidRuleOrientation + InvalidRuleOrientation

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    + + + +

    Exception raised for an invalid rule orientation.

    + - -

    Exception raised for an invalid rule orientation.

    -
    + + +
    @@ -7725,7 +8165,7 @@

    -
    +
    diff --git a/widgets/select/index.html b/widgets/select/index.html index 0d4c5de15d..91f58024eb 100644 --- a/widgets/select/index.html +++ b/widgets/select/index.html @@ -4707,89 +4707,170 @@
  • - textual.widgets.Select +  Select
  • - + - BINDINGS +  options
  • - + - BLANK +  prompt
  • - + - expanded +  allow_blank
  • - + - prompt +  value
  • - + - value +  name
  • - + - Changed +  id -
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  tooltip + + + +
  • + +
  • + + +  BINDINGS + + + +
  • + +
  • + + +  BLANK + + + +
  • + +
  • + + +  expanded + + + +
  • + +
  • + + +  prompt + + + +
  • + +
  • + + +  value + + + +
  • + +
  • + + +  Changed + + + +
  • @@ -7959,23 +8375,23 @@

    -

    - BLANK +

    + BLANK + - - instance-attribute class-attribute + instance-attribute -

    -
    BLANK = BLANK
    +
    +
    BLANK = BLANK
     
    -
    - -

    Constant to flag that the widget has no selection.

    -
    +
    + +

    Constant to flag that the widget has no selection.

    +
    @@ -7983,23 +8399,23 @@

    -

    - expanded +

    + expanded + - - instance-attribute class-attribute + instance-attribute -

    -
    expanded: var[bool] = var(False, init=False)
    +
    +
    expanded = var(False, init=False)
     
    -
    - -

    True to show the overlay, otherwise False.

    -
    +
    + +

    True to show the overlay, otherwise False.

    +
    @@ -8007,23 +8423,23 @@

    -

    - prompt +

    + prompt + - - instance-attribute class-attribute + instance-attribute -

    -
    prompt: var[str] = prompt
    +
    +
    prompt = prompt
     
    -
    - -

    The prompt to show when no value is selected.

    -
    +
    + +

    The prompt to show when no value is selected.

    +
    @@ -8031,28 +8447,28 @@

    -

    - value +

    + value + - - instance-attribute class-attribute + instance-attribute -

    -
    value: var[SelectType | NoSelection] = var[
    -    Union[SelectType, NoSelection]
    -](BLANK, init=False)
    +
    +
    value = var[Union[SelectType, NoSelection]](
    +    BLANK, init=False
    +)
     
    -
    - -

    The value of the selection.

    -

    If the widget has no selection, its value will be Select.BLANK. +

    + +

    The value of the selection.

    +

    If the widget has no selection, its value will be Select.BLANK. Setting this to an illegal value will raise a InvalidSelectValueError exception.

    -
    +
    @@ -8061,25 +8477,30 @@

    -

    - Changed +

    + Changed -

    -
    Changed(select, value)
    +
    +
    Changed(select, value)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when the select value was changed.

    + + +

    Posted when the select value was changed.

    This message can be handled using a on_select_changed method.

    - + + + + +
    @@ -8093,22 +8514,22 @@

    -

    - control +

    + control + - property -

    -
    control: Select[SelectType]
    +
    +
    control
     
    -
    - -

    The Select that sent the message.

    -
    +
    + +

    The Select that sent the message.

    +
    @@ -8116,22 +8537,22 @@

    -

    - select +

    + select + - instance-attribute -

    -
    select = select
    +
    +
    select = select
     
    -
    - -

    The select widget.

    -
    +
    + +

    The select widget.

    +
    @@ -8139,22 +8560,22 @@

    -

    - value +

    + value + - instance-attribute -

    -
    value = value
    +
    +
    value = value
     
    -
    - -

    The value of the Select when it changed.

    -
    +
    + +

    The value of the Select when it changed.

    +
    @@ -8164,7 +8585,7 @@

    -
    +
    @@ -8172,314 +8593,385 @@

    +

    + action_show_overlay -

    - action_show_overlay - -

    -
    action_show_overlay()
    +

    +
    action_show_overlay()
     
    -
    - -

    Show the overlay.

    +
    -
    +

    Show the overlay.

    + +
    - -

    - clear +

    + clear -

    -
    clear()
    +
    +
    clear()
     
    -
    - -

    Clear the selection if allow_blank is True.

    +
    + +

    Clear the selection if allow_blank is True.

    -

    Raises:

    - - - - - - - - + +

    Raises:

    +
    TypeDescription
    + - - + + - -
    - InvalidSelectValueError -

    If allow_blank is set to False.

    TypeDescription
    + + + + + InvalidSelectValueError + + +
    +

    If allow_blank is set to False.

    +
    + + + + -
    +
    +

    + from_values -

    - from_values - classmethod -

    -
    from_values(
    -    values,
    +
    +
    from_values(
    +    values,
         *,
    -    prompt="Select",
    -    allow_blank=True,
    -    value=BLANK,
    -    name=None,
    -    id=None,
    -    classes=None,
    -    disabled=False
    +    prompt="Select",
    +    allow_blank=True,
    +    value=BLANK,
    +    name=None,
    +    id=None,
    +    classes=None,
    +    disabled=False
     )
     
    -
    - -

    Initialize the Select control with values specified by an arbitrary iterable

    +
    + +

    Initialize the Select control with values specified by an arbitrary iterable

    The options shown in the control are computed by calling the built-in str on each value.

    -

    Parameters:

    - - - - - - - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    values - Iterable[SelectType] -

    Values used to generate options to select from.

    - required -
    + - - - - + + + + - - - - + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    prompt - str -

    Text to show in the control when no option is selected.

    - 'Select' - NameTypeDescriptionDefault
    allow_blank - bool -

    Enables or disables the ability to have the widget in a state +

    +

    values +

    + Iterable[SelectType] + +
    +

    Values used to generate options to select from.

    +
    +
    + required +
    +

    prompt +

    + str + +
    +

    Text to show in the control when no option is selected.

    +
    +
    + 'Select' +
    +

    allow_blank +

    + bool + +
    +

    Enables or disables the ability to have the widget in a state with no selection made, in which case its value is set to the constant -Select.BLANK.

    - True -
    value - SelectType | NoSelection -

    Initial value selected. Should be one of the values in values. +Select.BLANK.

    + +
    + True +
    +

    value +

    + SelectType | NoSelection + +
    +

    Initial value selected. Should be one of the values in values. If no initial value is set and allow_blank is False, the widget -will auto-select the first available value.

    - BLANK -
    name - str | None -

    The name of the select control.

    - None -
    id - str | None -

    The ID of the control in the DOM.

    - None -
    classes - str | None -

    The CSS classes of the control.

    - None -
    disabled - bool -

    Whether the control is disabled or not.

    - False -
    - -

    Returns:

    - - - - - - - - +will auto-select the first available value.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    + BLANK +
    +

    name +

    + str | None + +
    +

    The name of the select control.

    +
    +
    + None +
    +

    id +

    + str | None + +
    +

    The ID of the control in the DOM.

    +
    +
    + None +
    +

    classes +

    + str | None + +
    +

    The CSS classes of the control.

    +
    +
    + None +
    +

    disabled +

    + bool + +
    +

    Whether the control is disabled or not.

    +
    +
    + False +
    + + +

    Returns:

    + + - - + + - -
    - Select[SelectType] -

    A new Select widget with the provided values as options.

    TypeDescription
    + + + + + Select[SelectType] + + +
    +

    A new Select widget with the provided values as options.

    +
    + + + + -
    +
    - -

    - is_blank +

    + is_blank -

    -
    is_blank()
    +
    +
    is_blank()
     
    -
    - -

    Indicates whether this Select is blank or not.

    +
    + +

    Indicates whether this Select is blank or not.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - bool -

    True if the selection is blank, False otherwise.

    TypeDescription
    + + + + + bool + + +
    +

    True if the selection is blank, False otherwise.

    +
    + + + + -
    +
    +

    + set_options -

    - set_options - -

    -
    set_options(options)
    +
    +
    set_options(options)
     
    -
    - -

    Set the options for the Select.

    +
    + +

    Set the options for the Select.

    This will reset the selection. The selection will be empty, if allowed, otherwise the first valid option is picked.

    -

    Parameters:

    - - - - - - - - - - + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    options - Iterable[tuple[RenderableType, SelectType]] -

    An iterable of tuples containing the renderable to display for each -option and the corresponding internal value.

    - required - NameTypeDescriptionDefault
    - -

    Raises:

    - - - - - - - - + + + + + + + + + +
    TypeDescription
    +

    options +

    + Iterable[tuple[RenderableType, SelectType]] + +
    +

    An iterable of tuples containing the renderable to display for each +option and the corresponding internal value.

    +
    +
    + required +
    + + +

    Raises:

    + + - - + + - -
    - EmptySelectError -

    If the options iterable is empty and allow_blank is -False.

    TypeDescription
    + + + + + EmptySelectError + + +
    +

    If the options iterable is empty and allow_blank is +False.

    +
    + + + + -
    +
    @@ -8487,17 +8979,23 @@

    -
    +
    + -
    +
    + + + + + + -
    @@ -8513,22 +9011,27 @@

    - EmptySelectError + EmptySelectError

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    + + + +

    Raised when a Select has no options and allow_blank=False.

    + - -

    Raised when a Select has no options and allow_blank=False.

    -
    + + +
    @@ -8537,22 +9040,27 @@

    - InvalidSelectValueError + InvalidSelectValueError

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Raised when setting a Select to an unknown option.

    + + +

    Raised when setting a Select to an unknown option.

    -
    + + + + +
    @@ -8561,7 +9069,7 @@

    -
    +
    diff --git a/widgets/selection_list/index.html b/widgets/selection_list/index.html index eeeb8d6cc0..f5476287c4 100644 --- a/widgets/selection_list/index.html +++ b/widgets/selection_list/index.html @@ -4728,62 +4728,107 @@
  • - textual.widgets.SelectionList +  SelectionList
  • - + - BINDINGS +  *selections
  • - + - COMPONENT_CLASSES +  name
  • - + - selected +  id
  • - + - SelectedChanged +  classes -
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  BINDINGS + + + +
  • + +
  • + + +  COMPONENT_CLASSES + + + +
  • + +
  • + + +  selected + + + +
  • + +
  • + + +  SelectedChanged + + + +
  • diff --git a/widgets/sparkline/index.html b/widgets/sparkline/index.html index 9dc4d819b6..50a874040a 100644 --- a/widgets/sparkline/index.html +++ b/widgets/sparkline/index.html @@ -4740,34 +4740,88 @@
  • - textual.widgets.Sparkline +  Sparkline
  • - + - COMPONENT_CLASSES +  data
  • - + - data +  summary_function
  • - + - summary_function +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  COMPONENT_CLASSES + + + +
  • + +
  • + + +  data + + + +
  • + +
  • + + +  summary_function @@ -6605,34 +6659,88 @@
  • - textual.widgets.Sparkline +  Sparkline + + + +
  • + +
  • + + +  data + + + +
  • + +
  • + + +  summary_function + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id
  • - + - COMPONENT_CLASSES +  classes
  • - + - data +  disabled
  • - + - summary_function +  COMPONENT_CLASSES + + + +
  • + +
  • + + +  data + + + +
  • + +
  • + + +  summary_function @@ -7877,17 +7985,20 @@

    Component Classes - -

    Use these component classes to define the two colors that the sparkline + + +

    + +

    Use these component classes to define the two colors that the sparkline interpolates to represent its numerical data.

    +
    Note

    These two component classes are used exclusively for the color of the sparkline widget. Setting any style other than color will have no effect.

    -
    +
    @@ -7905,7 +8016,7 @@

    Component ClassesComponent Classes + -
    -

    - Bases: Widget

    +
    +

    + Bases: Widget

    - -

    A sparkline widget to display numerical data.

    - -

    Parameters:

    -

    Class
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +

    A sparkline widget to display numerical data.

    + + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    data - Sequence[float] | None -

    The initial data to populate the sparkline with.

    - None -
    summary_function - Callable[[Sequence[float]], float] | None -

    Summarizes bar values into a single value used to -represent each bar.

    - None -
    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 - NameTypeDescriptionDefault
    + + + + +

    data +

    + + Sequence[float] | None + + +
    +

    The initial data to populate the sparkline with.

    +
    + + + None + + + + +

    summary_function +

    + + Callable[[Sequence[float]], float] | None + + +
    +

    Summarizes bar values into a single value used to +represent each bar.

    +
    + + + None + + + + +

    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 + + + + + + + + + + -
    @@ -8013,32 +8167,33 @@

    Component Classes - COMPONENT_CLASSES +

    + COMPONENT_CLASSES + - class-attribute -

    -
    COMPONENT_CLASSES: set[str] = {
    +

    +
    COMPONENT_CLASSES = {
         "sparkline--max-color",
         "sparkline--min-color",
     }
     
    -
    - -

    Use these component classes to define the two colors that the sparkline +

    + +

    Use these component classes to define the two colors that the sparkline interpolates to represent its numerical data.

    +
    Note

    These two component classes are used exclusively for the color of the sparkline widget. Setting any style other than color will have no effect.

    -
    +
    @@ -8056,7 +8211,7 @@

    - data +

    + data + - - instance-attribute class-attribute + instance-attribute -

    -
    data = data
    +
    +
    data = data
     
    -
    - -

    The data that populates the sparkline.

    -
    +
    + +

    The data that populates the sparkline.

    +
    @@ -8088,25 +8243,25 @@

    -

    - summary_function +

    + summary_function + - - instance-attribute class-attribute + instance-attribute -

    -
    summary_function = reactive[
    -    Callable[[Sequence[float]], float]
    -](_max_factory)
    +
    +
    summary_function = reactive[
    +    Callable[[Sequence[float]], float]
    +](_max_factory)
     
    -
    - -

    The function that computes the value that represents each bar.

    -
    +
    + +

    The function that computes the value that represents each bar.

    +
    @@ -8116,7 +8271,7 @@

    - textual.widgets.Static +  Static
  • - + - update() +  renderable +
  • + +
  • + + +  expand + + + +
  • + +
  • + + +  shrink + + + +
  • + +
  • + + +  markup + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  update + + + + +
  • @@ -6539,19 +6626,106 @@
  • - textual.widgets.Static +  Static
  • - + - update() +  renderable +
  • + +
  • + + +  expand + + + +
  • + +
  • + + +  shrink + + + +
  • + +
  • + + +  markup + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  update + + + + +
  • @@ -6772,111 +6946,166 @@

    See Also + -
    -

    - Bases: Widget

    - - -

    A widget to display simple static content, or use as a base class for more complex widgets.

    - -

    Parameters:

    -

    Class
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
    +

    + Bases: Widget

    + + + +

    A widget to display simple static content, or use as a base class for more complex widgets.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    renderable - RenderableType -

    A Rich renderable, or string containing console markup.

    - '' -
    expand - bool -

    Expand content if required to fill container.

    - False -
    shrink - bool -

    Shrink content if required to fill container.

    - False -
    markup - bool -

    True if markup should be parsed and rendered.

    - True -
    name - str | None -

    Name of widget.

    - None -
    id - str | None -

    ID of Widget.

    - None -
    classes - str | None -

    Space separated list of class names.

    - None -
    + - - - - + + + + - -
    disabled - bool -

    Whether the static is disabled or not.

    - False - NameTypeDescriptionDefault
    + + + + +

    renderable +

    + + RenderableType + + +
    +

    A Rich renderable, or string containing console markup.

    +
    + + + '' + + + + +

    expand +

    + + bool + + +
    +

    Expand content if required to fill container.

    +
    + + + False + + + + +

    shrink +

    + + bool + + +
    +

    Shrink content if required to fill container.

    +
    + + + False + + + + +

    markup +

    + + bool + + +
    +

    True if markup should be parsed and rendered.

    +
    + + + True + + + + +

    name +

    + + str | None + + +
    +

    Name of widget.

    +
    + + + None + + + + +

    id +

    + + str | None + + +
    +

    ID of Widget.

    +
    + + + None + + + + +

    classes +

    + + str | None + + +
    +

    Space separated list of class names.

    +
    + + + None + + + + +

    disabled +

    + + bool + + +
    +

    Whether the static is disabled or not.

    +
    + + + False + + + + + + + + + -
    @@ -6891,44 +7120,50 @@

    See Also - -

    - update +

    + update -

    -
    update(renderable='')
    +

    +
    update(renderable='')
     
    -
    - -

    Update the widget's content area with new text or Rich renderable.

    - -

    Parameters:

    - - - - - - - - - - +
    + +

    Update the widget's content area with new text or Rich renderable.

    + + +

    Parameters:

    +
    NameTypeDescriptionDefault
    + - - - - + + + + - -
    renderable - RenderableType -

    A new rich renderable. Defaults to empty renderable;

    - '' - NameTypeDescriptionDefault
    + + + + +

    renderable +

    + + RenderableType + + +
    +

    A new rich renderable. Defaults to empty renderable;

    +
    + + + '' + + + + -
    +
    @@ -6936,7 +7171,7 @@

    -
    +

  • diff --git a/widgets/switch/index.html b/widgets/switch/index.html index 9eb81dd431..00aec20f8d 100644 --- a/widgets/switch/index.html +++ b/widgets/switch/index.html @@ -4758,53 +4758,116 @@
  • - textual.widgets.Switch +  Switch
  • - + - BINDINGS +  value
  • - + - COMPONENT_CLASSES +  animate
  • - + - value +  name
  • - + - Changed +  id -
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  tooltip + + + +
  • + +
  • + + +  BINDINGS + + + +
  • + +
  • + + +  COMPONENT_CLASSES + + + +
  • + +
  • + + +  value + + + +
  • + +
  • + + +  Changed + + + +
  • @@ -7170,21 +7349,21 @@

    -

    - COMPONENT_CLASSES +

    + COMPONENT_CLASSES + - class-attribute -

    -
    COMPONENT_CLASSES: set[str] = {'switch--slider'}
    +
    +
    COMPONENT_CLASSES = {'switch--slider'}
     
    -
    - - +
    + +
    @@ -7198,7 +7377,7 @@

    - value +

    + value + - - instance-attribute class-attribute + instance-attribute -

    -
    value: reactive[bool] = reactive(False, init=False)
    +
    +
    value = reactive(False, init=False)
     
    -
    - -

    The value of the switch; True for on and False for off.

    -
    +
    + +

    The value of the switch; True for on and False for off.

    +
    @@ -7231,53 +7410,67 @@

    -

    - Changed +

    + Changed -

    -
    Changed(switch, value)
    +
    +
    Changed(switch, value)
     
    -
    -

    - Bases: Message

    +
    +

    + Bases: Message

    - -

    Posted when the status of the switch changes.

    + + +

    Posted when the status of the switch changes.

    Can be handled using on_switch_changed in a subclass of Switch or in a parent widget in the DOM.

    -

    Attributes:

    -
    Class
    - - - - - - - - - - - - - + +

    Attributes:

    +
    NameTypeDescription
    value - bool -

    The value that the switch was changed to.

    + - - - + + + - -
    switch - Switch -

    The Switch widget that was changed.

    NameTypeDescription
    + + + + value + + bool + + +
    +

    The value that the switch was changed to.

    +
    + + + + switch + + Switch + + +
    +

    The Switch widget that was changed.

    +
    + + + + + + + + + -
    @@ -7291,22 +7484,22 @@

    -

    - control +

    + control + - property -

    -
    control: Switch
    +
    +
    control
     
    -
    - -

    Alias for self.switch.

    -
    +
    + +

    Alias for self.switch.

    +
    @@ -7316,7 +7509,7 @@

    -
    +
    @@ -7324,60 +7517,63 @@

    - -

    - action_toggle_switch +

    + action_toggle_switch -

    -
    action_toggle_switch()
    +

    +
    action_toggle_switch()
     
    -
    - -

    Toggle the state of the switch.

    +
    -
    +

    Toggle the state of the switch.

    + +
    +

    + toggle -

    - toggle - -

    -
    toggle()
    +
    +
    toggle()
     
    -
    - -

    Toggle the switch value.

    +
    + +

    Toggle the switch value.

    As a result of the value changing, a Switch.Changed message will be posted.

    -

    Returns:

    - - - - - - - - + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Self -

    The Switch instance.

    TypeDescription
    + + + + + Self + + +
    +

    The Switch instance.

    +
    + + + + -
    +
    @@ -7385,7 +7581,7 @@

    - + diff --git a/widgets/tabbed_content/index.html b/widgets/tabbed_content/index.html index 905b9d061e..1701f21eb2 100644 --- a/widgets/tabbed_content/index.html +++ b/widgets/tabbed_content/index.html @@ -4815,62 +4815,125 @@
  • - textual.widgets.TabbedContent +  TabbedContent
  • - + - active +  *titles
  • - + - active_pane +  initial
  • - + - tab_count +  name
  • - + - Cleared +  id -
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  active + + + +
  • + +
  • + + +  active_pane + + + +
  • + +
  • + + +  tab_count + + + +
  • + +
  • + + +  Cleared + + + +