diff --git a/api/app/index.html b/api/app/index.html index 81a9cc125f..ed5bf602be 100644 --- a/api/app/index.html +++ b/api/app/index.html @@ -4954,7 +4954,7 @@
  • - textual.app +  app @@ -4963,7 +4963,7 @@
  • - AutopilotCallbackType +  AutopilotCallbackType @@ -4972,7 +4972,7 @@
  • - CommandCallback +  CommandCallback @@ -4981,7 +4981,7 @@
  • - ScreenType +  ScreenType @@ -4990,7 +4990,7 @@
  • - ActionError +  ActionError @@ -4999,7 +4999,7 @@
  • - ActiveModeError +  ActiveModeError @@ -5008,17 +5008,53 @@
  • - App +  App -
  • + +
  • + - ScreenStackError +  end_capture_print -
  • - -
  • - + + +
  • + +
  • + - SystemCommand +  exit -
  • - + + +  export_screenshot + + + +
  • - -
  • - + +
  • + - UnknownModeError +  get_child_by_id -
  • - -
  • - + - -
  • - - - - - - + +
  • + + +  expect_type + + +
  • + + + + + +
  • + + +  get_child_by_type + + + - - textual.await_complete - +
  • + +
  • + + +  get_css_variables + + - - -
  • + + +
  • + + +  get_default_screen + + - - - - - +
  • + +
  • + + +  get_driver_class + + +
  • + +
  • + + +  get_key_display + + + -
  • - +
  • +
  • + + +  get_loading_widget + + - - textual.await_remove - +
  • + +
  • + + +  get_pseudo_classes + + - - -
  • + + +
  • + + +  get_screen + + - - - - - + +
  • + +
  • + + +  get_system_commands + + -
  • - + - - - - - +
  • + +
  • + + +  get_widget_at + + + -
  • - +
  • +
  • + + +  get_widget_by_id + + - - textual.cache - + +
  • + +
  • + + +  install_screen + + + - - textual.color - +
  • + +
  • + + +  is_mounted + + - - -
  • + + + +
  • + + +  is_screen_installed + + + -
  • - +
  • +
  • + + +  mount + + - - textual.command - + +
  • + +
  • + + +  mount_all + + + - - - - - +
  • + +
  • + + +  notify + + + +
  • + +
  • + + +  open_url + + + - - textual.coordinate - +
  • + +
  • + + +  panic + + - - -
  • + + + +
  • + + +  pop_screen + + +
  • + +
  • + + +  post_display_hook + + +
  • + +
  • + + +  push_screen + + -
  • - + +
  • + +
  • + + +  push_screen_wait + + + -
  • - +
  • +
  • + + +  recompose + + - - textual.events - +
  • + +
  • + + +  refresh + + - - -
  • + + + +
  • + + +  refresh_css + + -
  • - + - - -
  • + + +
  • + + +  remove_mode + + - - - - - + +
  • + +
  • + + +  render + + +
  • + +
  • + + +  run + + -
  • - + - - -
  • + + +
  • + + +  run_action + + - - - - - + +
  • + +
  • + + +  run_async + + -
  • - + -
  • - +
  • +
  • + + +  run_test + + - - textual.lazy - + -
  • - +
  • +
  • + + +  save_screenshot + + - - textual - + +
  • + +
  • + + +  set_focus + + + -
  • - +
  • +
  • + + +  simulate_key + + - - textual.map_geometry - + - - - - - +
  • + +
  • + + +  stop_animation + + + -
  • - +
  • +
  • + + +  suspend + + - - textual.message_pump - +
  • + +
  • + + +  switch_mode + + - - -
  • + + + +
  • + + +  switch_screen + + + -
  • - +
  • +
  • + + +  uninstall_screen + + - - textual.message - + - - - - - +
  • + +
  • + + +  update_styles + + +
  • + +
  • + + +  validate_sub_title + + +
  • + +
  • + + +  validate_title + + +
  • + +
  • + + +  watch_dark + + -
  • - +
  • + + - - textual.on - + + +
  • + + +  AppError + + - - -
  • + + +
  • + + +  InvalidModeError + + - - - - - +
  • + +
  • + + +  ModeError + + + +
  • + +
  • + + +  ScreenError + + +
  • + +
  • + + +  ScreenStackError + + +
  • + +
  • + + +  SuspendNotSupported + + +
  • + +
  • + + +  SystemCommand + + -
  • - + + +
  • + +
  • + + +  UnknownModeError + + + +
  • + +
  • + + +  get_system_commands_provider + + + +
  • + + + + + @@ -6839,11 +7820,11 @@
  • - + - textual.css.query + textual.await_complete @@ -6860,11 +7841,11 @@
  • - + - textual.reactive + textual.await_remove @@ -6881,11 +7862,11 @@
  • - + - textual.renderables + textual.binding @@ -6902,11 +7883,11 @@
  • - + - textual.screen + textual.cache @@ -6923,11 +7904,11 @@
  • - + - textual.scrollbar + textual.color @@ -6944,11 +7925,11 @@
  • - + - textual.scroll_view + textual.command @@ -6965,11 +7946,11 @@
  • - + - textual.signal + textual.constants @@ -6986,11 +7967,11 @@
  • - + - textual.strip + textual.containers @@ -7007,11 +7988,11 @@
  • - + - textual.suggester + textual.coordinate @@ -7028,11 +8009,11 @@
  • - + - textual.system_commands + textual.dom @@ -7049,11 +8030,11 @@
  • - + - textual.timer + textual.events @@ -7070,11 +8051,11 @@
  • - + - textual.types + textual.errors @@ -7091,11 +8072,11 @@
  • - + - textual.validation + textual.filter @@ -7112,11 +8093,11 @@
  • - + - textual.walk + textual.fuzzy @@ -7133,11 +8114,11 @@
  • - + - textual.widget + textual.geometry @@ -7154,11 +8135,11 @@
  • - + - textual.work + textual.lazy @@ -7175,11 +8156,11 @@
  • - + - textual.worker + textual @@ -7196,11 +8177,11 @@
  • - + - textual.worker_manager + textual.logging @@ -7210,75 +8191,25 @@ - - - -
  • - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - -
  • - - - - +
  • + - - - - - - -
  • - - - - - + +
  • - + - FAQ + textual.reactive @@ -7412,19 +8336,20 @@
  • - - - + + + +
  • - + - Roadmap + textual.renderables @@ -7432,63 +8357,48 @@
  • - - - + + + + - - - - - - - +
  • + - - - - - - - - - -
  • - - - - - - - -
  • + + - - + + + + + + +
  • + - + + + + + + +
    +
    +
    + + + - - - - -
    -
    -
    - - - -
    -
    -
    - - -
  • + +
  • + + +  deliver_binary + + + + +
  • + +
  • + + +  deliver_screenshot + + + + + +
  • + +
  • + - App +  deliver_text -
  • - + - COMMAND_PALETTE_DISPLAY +  end_capture_print -
  • + +
  • - + - CSS_PATH +  exit -
  • + +
  • - + - MODES +  export_screenshot -
  • + +
  • - + - SUB_TITLE +  get_child_by_id -
  • + +
  • - + - active_bindings +  get_child_by_type -
  • + +
  • - + - animator +  get_css_variables
  • - + - ansi_color +  get_default_screen
  • - + - ansi_theme +  get_driver_class
  • - + - ansi_theme_dark +  get_key_display -
  • + +
  • - + - app_focus +  get_loading_widget
  • - + - app_resume_signal +  get_pseudo_classes
  • - + - app_suspend_signal +  get_screen -
  • + +
  • - + - cursor_position +  get_system_commands -
  • + +
  • - + - debug +  get_widget_at -
  • + +
  • - + - is_attached +  get_widget_by_id -
  • + +
  • - + - is_inline +  install_screen -
  • + +
  • - + - return_value +  is_mounted -
  • + +
  • - + - screen_stack +  is_screen_installed -
  • + +
  • - + - scroll_sensitivity_y +  mount -
  • + +
  • - + - use_command_palette +  mount_all -
  • + +
  • - + - action_bell() +  notify -
  • + +
  • - + - action_hide_help_panel() +  open_url -
  • + +
  • - + - action_quit() +  panic -
  • + +
  • - + - action_screenshot() +  pop_screen
  • - + - action_show_help_panel() +  post_display_hook
  • - + - action_simulate_key() +  push_screen -
  • + +
  • - + - action_toggle_class() +  push_screen_wait -
  • + +
  • - + - add_mode() +  recompose
  • - + - animate() +  refresh -
  • + +
  • - + - bind() +  refresh_css -
  • + +
  • - + - capture_mouse() +  remove_mode -
  • + +
  • - + - compose() +  render
  • - + - copy_to_clipboard() +  run -
  • +
  • - + - get_child_by_type() +  run_action -
  • +
  • - + - get_key_display() +  run_async -
  • +
  • - + - is_mounted() +  run_test -
  • +
  • - + - pop_screen() +  save_screenshot -
  • +
  • - + - refresh() +  set_focus -
  • +
  • - + - run() +  simulate_key -
  • + +
  • - + - run_async() +  stop_animation -
  • + +
  • - + - set_focus() +  suspend
  • - + - simulate_key() +  switch_mode -
  • + +
  • - + - suspend() +  switch_screen -
  • + +
  • - + - switch_screen() +  uninstall_screen -
  • + +
  • - update_styles() +  update_styles @@ -9005,7 +11933,7 @@
  • - validate_sub_title() +  validate_sub_title @@ -9014,7 +11942,7 @@
  • - validate_title() +  validate_title @@ -9023,7 +11951,7 @@
  • - watch_dark() +  watch_dark @@ -9037,7 +11965,7 @@
  • - AppError +  AppError @@ -9046,7 +11974,7 @@
  • - InvalidModeError +  InvalidModeError @@ -9055,7 +11983,7 @@
  • - ModeError +  ModeError @@ -9064,7 +11992,7 @@
  • - ScreenError +  ScreenError @@ -9073,7 +12001,7 @@
  • - ScreenStackError +  ScreenStackError @@ -9082,7 +12010,7 @@
  • - SuspendNotSupported +  SuspendNotSupported @@ -9091,17 +12019,17 @@
  • - SystemCommand +  SystemCommand -
  • + +
  • + + +  Monochrome + + + + + +
  • + +
  • + + +  NoColor + + + + + +
  • + +
  • + + +  dim_color + + + + + +
  • + +
  • + + +  dim_style + + + + + +
  • + +
  • + + +  monochrome_style + + + + + +
  • + + + + @@ -6750,10 +7200,11 @@

    textual.filter

    + -
    - -

    Filter classes.

    +
    + +

    Filter classes.

    Note

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

    @@ -6762,7 +7213,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.

    - + + + + + +
    @@ -6777,21 +7233,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.

    +
    @@ -6801,48 +7257,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 + + + + + + + + + + -
    @@ -6857,138 +7325,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.

    +
    + + + + -
    +
    @@ -6996,7 +7492,7 @@

    -
    +
    @@ -7005,48 +7501,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 + + + + + + + + + + -
    @@ -7061,72 +7569,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.

    +
    + + + + -
    +
    @@ -7134,7 +7659,7 @@

    -
    +
    @@ -7143,23 +7668,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.

    -
    @@ -7174,76 +7704,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.

    +
    + + + + -
    +
    @@ -7251,7 +7798,7 @@

    -
    +
    @@ -7260,22 +7807,28 @@

    - Monochrome + Monochrome

    +
    Monochrome(enabled=True)
    +
    + +
    +

    + Bases: LineFilter

    + + + +

    Convert all colors to monochrome.

    + + -
    -

    - Bases: LineFilter

    - -

    Convert all colors to monochrome.

    -
    @@ -7290,72 +7843,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.

    +
    + + + + -
    +
    @@ -7363,7 +7933,7 @@

    -
    +
    @@ -7372,22 +7942,28 @@

    - NoColor + NoColor

    +
    NoColor(enabled=True)
    +
    + +
    +

    + Bases: LineFilter

    + + + +

    Remove all color information from segments.

    + + -
    -

    - Bases: LineFilter

    - -

    Remove all color information from segments.

    -
    @@ -7402,72 +7978,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.

    +
    + + + + -
    +
    @@ -7475,7 +8068,7 @@

    -
    +
    @@ -7483,228 +8076,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.

    +
    + + + + -
    +
    @@ -7712,7 +8356,7 @@

    -
    +
    diff --git a/api/fuzzy_matcher/index.html b/api/fuzzy_matcher/index.html index fb0bcc2eb7..178a622249 100644 --- a/api/fuzzy_matcher/index.html +++ b/api/fuzzy_matcher/index.html @@ -5248,7 +5248,7 @@
  • - textual.fuzzy +  fuzzy @@ -5257,17 +5257,44 @@
  • - Matcher +  Matcher -
  • @@ -6460,7 +6517,7 @@
  • - textual.fuzzy +  fuzzy @@ -6469,17 +6526,44 @@
  • - Matcher +  Matcher -
  • @@ -6558,13 +6672,19 @@

    textual.fuzzy

    + -
    - -

    Fuzzy matcher.

    +
    + +

    Fuzzy matcher.

    This class is used by the command palette to match search terms.

    - + + + + + +
    @@ -6580,66 +6700,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 + + + + + + + + + + -
    @@ -6654,21 +6798,21 @@

    - case_sensitive + case_sensitive + - property

    -
    case_sensitive: bool
    +
    case_sensitive
     
    -
    - -

    Is this matcher case sensitive?

    -
    +
    + +

    Is this matcher case sensitive?

    +
    @@ -6677,21 +6821,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.

    +
    @@ -6700,21 +6844,21 @@

    - query + query + - property

    -
    query: str
    +
    query
     
    -
    - -

    The query string to look for.

    -
    +
    + +

    The query string to look for.

    +
    @@ -6723,21 +6867,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.

    +
    @@ -6746,124 +6890,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.

    +
    + + + + -
    +
    @@ -6871,7 +7037,7 @@

    -
    +
    @@ -6880,7 +7046,7 @@

    -
    +
    diff --git a/api/geometry/index.html b/api/geometry/index.html index 5f4441106a..223300bcec 100644 --- a/api/geometry/index.html +++ b/api/geometry/index.html @@ -5269,7 +5269,7 @@
  • - textual.geometry +  geometry @@ -5278,7 +5278,7 @@
  • - NULL_OFFSET +  NULL_OFFSET @@ -5287,7 +5287,7 @@
  • - NULL_REGION +  NULL_REGION @@ -5296,7 +5296,7 @@
  • - NULL_SIZE +  NULL_SIZE @@ -5305,7 +5305,7 @@
  • - NULL_SPACING +  NULL_SPACING @@ -5314,7 +5314,7 @@
  • - SpacingDimensions +  SpacingDimensions @@ -5323,17 +5323,17 @@
  • - Offset +  Offset -
  • - Region +  Region -
  • + + + +
  • + + +  translate + + + -
  • - +
  • +
  • + + +  translate_inside + + - - textual.lazy - + +
  • + +
  • + + +  union + + + - - textual - +
  • + + + - - - + + +
  • + + +  Size + + - - - - - + +
  • + +
  • + + +  Spacing + + -
  • - + +
  • + +
  • + + +  clamp + + -
  • - + + +
  • + + + + + + + + + + + + + + + + +
  • + + + + + textual.lazy + + + + +
  • + + + + + + + + + + +
  • + + + + + textual + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.logging + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.map_geometry + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.message_pump + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.message + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.on + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.pilot + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.css.query + + + + +
  • + + + + + + + + + + +
  • + + + + textual.reactive @@ -7091,205 +7808,833 @@ -
  • - +
  • + + + + + News + + + + +
  • + + + + + + + + + + + + +
  • + + + + + Release + + + + +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + - - - - -
    -
    -
    - - - -
    -
    -
    - - - + + + +
  • + - expand() +  Size -
  • + +
  • - + - Size +  Spacing -
  • - -
  • - +
  • + - Spacing +  all -
  • - + - css +  grow_maximum -
  • +
  • - + - right +  horizontal -
  • + +
  • - + - top_left +  unpack -
  • + +
  • - + - width +  vertical -
  • + + + + + + + + + +
  • + - grow_maximum() +  clamp -
  • + - - -
  • - - - clamp() - - -
  • @@ -7980,12 +9414,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).

    + + + + + + -
    @@ -8000,21 +9440,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).

    +
    @@ -8023,21 +9463,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).

    +
    @@ -8046,21 +9486,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).

    +
    @@ -8069,21 +9509,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.

    +
    @@ -8092,26 +9532,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.

    +
    @@ -8121,22 +9561,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
    @@ -8152,7 +9594,11 @@ 

    - + + + + +
    @@ -8167,21 +9613,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.

    +
    @@ -8190,21 +9636,21 @@

    - is_origin + is_origin + - property

    -
    is_origin: bool
    +
    is_origin
     
    -
    - -

    Is the offset at (0, 0)?

    -
    +
    + +

    Is the offset at (0, 0)?

    +
    @@ -8213,22 +9659,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)

    +
    @@ -8237,22 +9683,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)

    +
    @@ -8261,206 +9707,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.

    +
    + + + + -
    +
    @@ -8468,7 +9959,7 @@

    -
    +
    @@ -8477,18 +9968,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)
         ┌────────────────────┐ ▲
    @@ -8501,6 +9993,7 @@ 

    ◀─────── width ──────▶

    +
    Example
    >>> from textual.geometry import Region
    @@ -8521,7 +10014,11 @@ 

    - + + + + +
    @@ -8536,21 +10033,21 @@

    - area + area + - property

    -
    area: int
    +
    area
     
    -
    - -

    The area under the region.

    -
    +
    + +

    The area under the region.

    +
    @@ -8559,21 +10056,21 @@

    - bottom + bottom + - property

    -
    bottom: int
    +
    bottom
     
    -
    - -

    Maximum Y value (non inclusive).

    -
    +
    + +

    Maximum Y value (non inclusive).

    +
    @@ -8582,39 +10079,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.

    +
    + + + + +
    @@ -8623,39 +10125,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.

    +
    + + + + +
    @@ -8664,40 +10171,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.

    +
    + + + + +
    @@ -8706,21 +10218,21 @@

    - column_range + column_range + - property

    -
    column_range: range
    +
    column_range
     
    -
    - -

    A range object for X coordinates.

    -
    +
    + +

    A range object for X coordinates.

    +
    @@ -8729,22 +10241,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.

    -
    +
    @@ -8753,21 +10265,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.

    +
    @@ -8776,22 +10288,22 @@

    - height + height + - - instance-attribute class-attribute + instance-attribute

    -
    height: int = 0
    +
    height = 0
     
    -
    - -

    The height of the region.

    -
    +
    + +

    The height of the region.

    +
    @@ -8800,21 +10312,21 @@

    - line_range + line_range + - property

    -
    line_range: range
    +
    line_range
     
    -
    - -

    A range object for Y coordinates.

    -
    +
    + +

    A range object for Y coordinates.

    +
    @@ -8823,22 +10335,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.

    -
    +
    @@ -8847,39 +10359,44 @@

    - offset + offset + - property

    -
    offset: Offset
    +
    offset
     
    -
    - -

    The top left corner of the region.

    +
    -

    Returns:

    - - - - - - - - +

    The top left corner of the region.

    + + +

    Returns:

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

    An offset.

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

    An offset.

    +
    + + + + +
    @@ -8888,39 +10405,44 @@

    - reset_offset + reset_offset + - property

    -
    reset_offset: Region
    +
    reset_offset
     
    -
    - -

    An region of the same size at (0, 0).

    +
    -

    Returns:

    - - - - - - - - +

    An region of the same size at (0, 0).

    + + +

    Returns:

    +
    TypeDescription
    + - - + + - -
    - Region -

    A region at the origin.

    TypeDescription
    -
    + + + + + Region + + +
    +

    A region at the origin.

    +
    + + + + +
    @@ -8929,21 +10451,21 @@

    - right + right + - property

    -
    right: int
    +
    right
     
    -
    - -

    Maximum X value (non inclusive).

    -
    +
    + +

    Maximum X value (non inclusive).

    +
    @@ -8952,21 +10474,21 @@

    - size + size + - property

    -
    size: Size
    +
    size
     
    -
    - -

    Get the size of the region.

    -
    +
    + +

    Get the size of the region.

    +
    @@ -8975,39 +10497,44 @@

    - top_right + top_right + - property

    -
    top_right: Offset
    +
    top_right
     
    -
    - -

    Top right offset of the region.

    +
    -

    Returns:

    - - - - - - - - +

    Top right offset of the region.

    + + +

    Returns:

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

    An offset.

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

    An offset.

    +
    + + + + +
    @@ -9016,22 +10543,22 @@

    - width + width + - - instance-attribute class-attribute + instance-attribute

    -
    width: int = 0
    +
    width = 0
     
    -
    - -

    The width of the region.

    -
    +
    + +

    The width of the region.

    +
    @@ -9040,22 +10567,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).

    +
    @@ -9064,22 +10591,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).

    +
    @@ -9088,930 +10615,1120 @@

    -

    - 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(width, height)
     
    -
    - -

    Clip this region to fit within width, height.

    - -

    Parameters:

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

    Clip this region to fit within width, height.

    + + +

    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.

    +
    + + + + -
    +
    -

    - 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.

    @@ -10030,289 +11747,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 ↓
             ┌────────┐ ┌───┐
             │        │ │   │
    @@ -10324,83 +12097,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    │
                 │         │
    @@ -10410,72 +12200,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 │
    @@ -10483,134 +12284,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.

    ┌──────────────────┐         ┌──────────────────┐
    @@ -10623,136 +12446,171 @@ 

    │ │ └─────────────┘

    - -

    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.

    - -

    Parameters:

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

    Get the smallest region that contains both regions.

    + + +

    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.

    +
    + + + + -
    +
    @@ -10760,7 +12618,7 @@

    -
    +
    @@ -10769,18 +12627,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 @@ -10796,7 +12656,11 @@

    - + + + + +
    @@ -10811,21 +12675,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.

    +
    @@ -10834,22 +12698,22 @@

    - height + height + - - instance-attribute class-attribute + instance-attribute

    -
    height: int = 0
    +
    height = 0
     
    -
    - -

    The height in cells.

    -
    +
    + +

    The height in cells.

    +
    @@ -10858,21 +12722,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.

    +
    @@ -10881,21 +12745,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.

    +
    @@ -10904,22 +12768,22 @@

    - width + width + - - instance-attribute class-attribute + instance-attribute

    -
    width: int = 0
    +
    width = 0
     
    -
    - -

    The width in cells.

    -
    +
    + +

    The width in cells.

    +
    @@ -10928,320 +12792,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.

    +
    + + + + -
    +
    @@ -11249,7 +13174,7 @@

    -
    +
    @@ -11258,18 +13183,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
    @@ -11282,6 +13208,7 @@ 

    └ ─ ─ ─ ─ ─ ─ ─▼─ ─ ─ ─ ─ ─ ─ ─ ┘

    +
    Example
    >>> from textual.geometry import Region, Spacing
    @@ -11297,7 +13224,11 @@ 

    - + + + + +
    @@ -11312,22 +13243,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.

    +
    @@ -11336,21 +13267,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.

    +
    @@ -11359,22 +13290,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".

    -
    +
    @@ -11383,21 +13314,21 @@

    - height + height + - property

    -
    height: int
    +
    height
     
    -
    - -

    Total space in the y axis.

    -
    +
    + +

    Total space in the y axis.

    +
    @@ -11406,22 +13337,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.

    +
    @@ -11430,22 +13361,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.

    +
    @@ -11454,22 +13385,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.

    +
    @@ -11478,21 +13409,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.

    +
    @@ -11501,21 +13432,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.

    +
    @@ -11524,21 +13455,21 @@

    - width + width + - property

    -
    width: int
    +
    width
     
    -
    - -

    Total space in the x axis.

    -
    +
    + +

    Total space in the x axis.

    +
    @@ -11547,346 +13478,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)

    +
    + + + + -
    +
    @@ -11894,7 +13885,7 @@

    -
    +

    @@ -11902,86 +13893,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.

    +
    + + + + -
    +
    @@ -11989,7 +14003,7 @@

    -

    +
    diff --git a/api/lazy/index.html b/api/lazy/index.html index dd6fd5c0bf..0af2e362ad 100644 --- a/api/lazy/index.html +++ b/api/lazy/index.html @@ -5290,7 +5290,7 @@
  • - textual.lazy +  lazy @@ -5299,10 +5299,25 @@
  • - Lazy +  Lazy + + + + +
  • @@ -6400,7 +6415,7 @@
  • - textual.lazy +  lazy @@ -6409,10 +6424,25 @@
  • - Lazy +  Lazy + + + + +
  • @@ -6438,12 +6468,18 @@

    textual.lazy

    + -
    - -

    Tools for lazy loading widgets.

    +
    + +

    Tools for lazy loading widgets.

    + + + + + + -
    @@ -6459,19 +6495,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 @@ -6480,6 +6517,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:
    @@ -6489,34 +6527,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 + + + + + + + + + + -
    @@ -6532,7 +6581,7 @@

    -
    +
    @@ -6541,7 +6590,7 @@

    -
    +
    diff --git a/api/logger/index.html b/api/logger/index.html index 2530ffaf29..6656b1ee56 100644 --- a/api/logger/index.html +++ b/api/logger/index.html @@ -5311,7 +5311,7 @@
  • - textual +  textual @@ -5320,7 +5320,7 @@
  • - log +  log @@ -5329,17 +5329,17 @@
  • - Logger +  Logger -
  • - LoggerError +  LoggerError @@ -5443,19 +5458,121 @@
  • - on() +  on + + + + +
  • - work() +  work + + + + +
  • @@ -6532,7 +6649,7 @@
  • - textual +  textual @@ -6541,7 +6658,7 @@
  • - log +  log @@ -6550,17 +6667,17 @@
  • - Logger +  Logger -
  • - LoggerError +  LoggerError @@ -6664,19 +6796,121 @@
  • - on() +  on + + + + +
  • - work() +  work + + + + +
  • @@ -6702,13 +6936,19 @@

    textual

    + -
    - -

    The root Textual module.

    +
    + +

    The root Textual module.

    Exposes some commonly used symbols.

    - + + + + + +
    @@ -6723,27 +6963,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())
     
    -
    +
    @@ -6753,25 +6994,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.

    -
    @@ -6786,21 +7028,21 @@

    - debug + debug + - property

    -
    debug: Logger
    +
    debug
     
    -
    - -

    Logs debug messages.

    -
    +
    + +

    Logs debug messages.

    +
    @@ -6809,21 +7051,21 @@

    - error + error + - property

    -
    error: Logger
    +
    error
     
    -
    - -

    Logs errors.

    -
    +
    + +

    Logs errors.

    +
    @@ -6832,21 +7074,21 @@

    - event + event + - property

    -
    event: Logger
    +
    event
     
    -
    - -

    Logs events.

    -
    +
    + +

    Logs events.

    +
    @@ -6855,21 +7097,21 @@

    - info + info + - property

    -
    info: Logger
    +
    info
     
    -
    - -

    Logs information.

    -
    +
    + +

    Logs information.

    +
    @@ -6878,21 +7120,21 @@

    - logging + logging + - property

    -
    logging: Logger
    +
    logging
     
    -
    - -

    Logs from stdlib logging module.

    -
    +
    + +

    Logs from stdlib logging module.

    +
    @@ -6901,21 +7143,21 @@

    - system + system + - property

    -
    system: Logger
    +
    system
     
    -
    - -

    Logs system information.

    -
    +
    + +

    Logs system information.

    +
    @@ -6924,21 +7166,21 @@

    - verbose + verbose + - property

    -
    verbose: Logger
    +
    verbose
     
    -
    - -

    A verbose logger.

    -
    +
    + +

    A verbose logger.

    +
    @@ -6947,21 +7189,21 @@

    - warning + warning + - property

    -
    warning: Logger
    +
    warning
     
    -
    - -

    Logs warnings.

    -
    +
    + +

    Logs warnings.

    +
    @@ -6970,21 +7212,21 @@

    - worker + worker + - property

    -
    worker: Logger
    +
    worker
     
    -
    - -

    Logs worker information.

    -
    +
    + +

    Logs worker information.

    +
    @@ -6993,62 +7235,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.

    +
    + + + + -
    +
    @@ -7056,7 +7309,7 @@

    -
    +
    @@ -7065,22 +7318,27 @@

    - LoggerError + LoggerError

    -
    -

    - Bases: Exception

    +
    +

    + Bases: Exception

    - -

    Raised when the logger failed.

    +

    Raised when the logger failed.

    -
    + + + + + + +
    @@ -7088,21 +7346,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".
    @@ -7110,9 +7368,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".
    @@ -7122,167 +7381,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 + + + + -
    +
    @@ -7290,7 +7643,7 @@

    -
    +
    diff --git a/api/logging/index.html b/api/logging/index.html index e524e3a5ba..9a6822dd8b 100644 --- a/api/logging/index.html +++ b/api/logging/index.html @@ -5332,7 +5332,7 @@
  • - textual.logging +  logging @@ -5341,17 +5341,35 @@
  • - TextualHandler +  TextualHandler -
  • -
    -
    + + + + +
  • + + +  prevent + + + +
  • + +
  • + + +  set_interval + + + + + +
  • + +
  • + + +  set_timer + + + + + +
  • + + + + + + + + + +
    + + @@ -6828,16 +7266,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.

    - + + + + + +
    @@ -6853,21 +7297,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.

    -
    @@ -6882,57 +7331,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

    +
    + + + + +
    @@ -6941,21 +7400,21 @@

    - has_parent + has_parent + - property

    -
    has_parent: bool
    +
    has_parent
     
    -
    - -

    Does this object have a parent?

    -
    +
    + +

    Does this object have a parent?

    +
    @@ -6964,21 +7423,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?

    +
    @@ -6987,21 +7446,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)?

    +
    @@ -7010,21 +7469,21 @@

    - is_parent_active + is_parent_active + - property

    -
    is_parent_active: bool
    +
    is_parent_active
     
    -
    - -

    Is the parent active?

    -
    +
    + +

    Is the parent active?

    +
    @@ -7033,21 +7492,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)?

    +
    @@ -7056,39 +7515,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.

    +
    + + + + +
    @@ -7097,21 +7561,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.

    +
    @@ -7120,22 +7584,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.

    -
    +
    @@ -7144,462 +7608,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 @@ -7608,134 +8149,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 @@ -7745,79 +8321,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.

    +
    + + + + -
    +
    @@ -7825,7 +8431,7 @@

    -
    +
    @@ -7834,7 +8440,7 @@

    -
    +
    diff --git a/api/on/index.html b/api/on/index.html index 8796f9c3d1..acb421876a 100644 --- a/api/on/index.html +++ b/api/on/index.html @@ -5420,7 +5420,34 @@
  • - textual.on +  on + + + +
  • + +
  • + + +  message_type + + + +
  • + +
  • + + +  selector + + + +
  • + +
  • + + +  **kwargs @@ -6397,7 +6424,34 @@
  • - textual.on +  on + + + +
  • + +
  • + + +  message_type + + + +
  • + +
  • + + +  selector + + + +
  • + +
  • + + +  **kwargs @@ -6427,13 +6481,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".
    @@ -6441,9 +6497,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".
    @@ -6453,52 +6510,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 cdb8e434f2..7d12f2c009 100644 --- a/api/pilot/index.html +++ b/api/pilot/index.html @@ -5437,7 +5437,7 @@
  • - textual.pilot +  pilot @@ -5446,7 +5446,7 @@
  • - OutOfBounds +  OutOfBounds @@ -5455,17 +5455,17 @@
  • - Pilot +  Pilot -
  • + +
  • + + +  WaitForScreenTimeout + + + +
  • + + + + + + + + + + +
    +
    + @@ -6684,13 +7176,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.

    - + + + + + +
    @@ -6706,22 +7204,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.

    -
    + + +
    @@ -6730,23 +7233,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.

    -
    @@ -6761,21 +7269,21 @@

    - app + app + - property

    -
    app: App[ReturnType]
    +
    app
     
    -
    - - -
    +
    + + +
    @@ -6784,31 +7292,31 @@

    -

    - click + click + - async

    -
    click(
    -    selector=None,
    -    offset=(0, 0),
    -    shift=False,
    -    meta=False,
    -    control=False,
    +
    click(
    +    selector=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: @@ -6816,741 +7324,912 @@

    await pilot.click(Button, offset=(8, 1))

    -

    Parameters:

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

    Parameters:

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

    A selector to specify a widget that should be used as the reference +

    NameTypeDescriptionDefault
    +

    selector +

    + type[Widget] | str | None + +
    +

    A selector to specify a widget that should be used as the reference 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 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 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(selector=None, offset=(0, 0))
    +
    hover(selector=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
    + - - - + + + + + + + + + + - - - - - - - - - -
    selector - type[Widget] | str | None | None -

    A selector to specify a widget that should be used as the reference +

    NameTypeDescriptionDefault
    +

    selector +

    + type[Widget] | str | None | None + +
    +

    A selector to specify a widget that should be used as the reference 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 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 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(
    -    selector=None,
    -    offset=(0, 0),
    -    shift=False,
    -    meta=False,
    -    control=False,
    +
    mouse_down(
    +    selector=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
    + - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    selector - type[Widget] | str | None -

    A selector to specify a widget that should be used as the reference +

    NameTypeDescriptionDefault
    +

    selector +

    + type[Widget] | str | None + +
    +

    A selector to specify a widget that should be used as the reference 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 -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 +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(
    -    selector=None,
    -    offset=(0, 0),
    -    shift=False,
    -    meta=False,
    -    control=False,
    +
    mouse_up(
    +    selector=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
    + - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    selector - type[Widget] | str | None -

    A selector to specify a widget that should be used as the reference +

    NameTypeDescriptionDefault
    +

    selector +

    + type[Widget] | str | None + +
    +

    A selector to specify a widget that should be used as the reference 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 -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 +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.

    + +
    @@ -7558,7 +8237,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.

    -
    + + + + +
    @@ -7592,7 +8276,7 @@

    -
    +
    diff --git a/api/query/index.html b/api/query/index.html index 1cc9d21528..6dfe6901d8 100644 --- a/api/query/index.html +++ b/api/query/index.html @@ -5458,7 +5458,7 @@
  • - textual.css.query +  query @@ -5467,7 +5467,7 @@
  • - ExpectType +  ExpectType @@ -5476,7 +5476,7 @@
  • - QueryType +  QueryType @@ -5485,17 +5485,62 @@
  • - DOMQuery +  DOMQuery -
  • diff --git a/api/renderables/index.html b/api/renderables/index.html index a3b59e39c2..56d4e1543f 100644 --- a/api/renderables/index.html +++ b/api/renderables/index.html @@ -5500,7 +5500,7 @@
  • - textual.renderables.bar +  bar @@ -5509,16 +5509,67 @@
  • - Bar +  Bar + +
  • - textual.renderables.blank +  blank @@ -5527,7 +5578,7 @@
  • - Blank +  Blank @@ -5536,7 +5587,7 @@
  • - textual.renderables.digits +  digits @@ -5545,20 +5596,53 @@
  • - Digits +  Digits -
  • diff --git a/api/scrollbar/index.html b/api/scrollbar/index.html index bae531253a..3db9f8798b 100644 --- a/api/scrollbar/index.html +++ b/api/scrollbar/index.html @@ -5542,7 +5542,7 @@
  • - textual.scrollbar +  scrollbar @@ -5551,17 +5551,17 @@
  • - ScrollBar +  ScrollBar -
  • @@ -7738,23 +7987,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.

    -
    @@ -7768,22 +8022,22 @@

    -

    - base +

    + base + - property -

    -
    base: Styles
    +

    +
    base
     
    -
    - -

    Quick access to base (css) style.

    -
    +
    + +

    Quick access to base (css) style.

    +
    @@ -7791,22 +8045,22 @@

    -

    - css +

    + css + - property -

    -
    css: str
    +
    +
    css
     
    -
    - -

    Get the CSS for the combined styles.

    -
    +
    + +

    Get the CSS for the combined styles.

    +
    @@ -7814,40 +8068,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.

    +
    + + + + +
    @@ -7855,22 +8114,22 @@

    -

    - inline +

    + inline + - property -

    -
    inline: Styles
    +
    +
    inline
     
    -
    - -

    Quick access to the inline styles.

    -
    +
    + +

    Quick access to the inline styles.

    +
    @@ -7878,22 +8137,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.

    +
    @@ -7902,259 +8161,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.

    + +
    @@ -8162,7 +8477,7 @@

    -
    +
    @@ -8171,20 +8486,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.

    -
    + + + + +
    @@ -8193,7 +8513,7 @@

    - + diff --git a/api/validation/index.html b/api/validation/index.html index 4394a7721d..5f48079762 100644 --- a/api/validation/index.html +++ b/api/validation/index.html @@ -5710,7 +5710,7 @@
  • - textual.validation +  validation @@ -5719,17 +5719,17 @@
  • - Failure +  Failure -
  • + +
  • + + +  WidgetError + + + +
  • + + + + + +

  • + + + + + + + + + + +
  • + + + + + textual.work + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.worker + + + + +
  • + + + + + + + + + + +
  • + + + + + textual.worker_manager + + + + +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • + + + + + + + + + + + +
  • + + + + + + + + + +
  • + + + + + FAQ + + + + +
  • + + + + + + + + + +
  • + + + + + Roadmap + + + + +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + +
  • + + + + + + + + + + +
  • + + + + + + + + + + + +
    +
    +
    + + +
    + - - - - - -
    -
    - - - - -
    -
    -
    - - - + + + +
  • + + +  press + + + +
  • + +
  • + + +  success + + + + + +
  • + +
  • + + +  validate_label + + + +
  • + +
  • + + +  warning + + + + + +
  • + +
  • + + +  button + + + + + +
  • + + + + +
    +
    +
    + + + +
    +
    + + + + + + + +

    Button

    A simple button widget which can be pressed using a mouse click or by pressing Enter when it has focus.

      @@ -7091,7 +7577,7 @@

      Reactive AttributesMessages

      Bindings

      This widget has no bindings.

      @@ -7107,102 +7593,151 @@

      Additional Notes + -
      -

      - Bases: Widget

      +
      +

      + Bases: Widget

      - -

      A simple clickable button.

      - -

      Parameters:

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

      A simple clickable button.

      + + + +

      Parameters:

      +
      NameTypeDescriptionDefault
      label - TextType | None -

      The text that appears within the button.

      - None -
      variant - ButtonVariant -

      The variant of the button.

      - 'default' -
      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 -
      + - - - - + + + + - -
      tooltip - RenderableType | None -

      Optional tooltip.

      - None - NameTypeDescriptionDefault
      + + + + +

      label +

      + + TextType | None + + +
      +

      The text that appears within the button.

      +
      + + + None + + + + +

      variant +

      + + ButtonVariant + + +
      +

      The variant of the button.

      +
      + + + 'default' + + + + +

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

      tooltip +

      + + RenderableType | None + + +
      +

      Optional tooltip.

      +
      + + + None + + + + + + + + + + -
      @@ -7216,22 +7751,22 @@

      Additional Notes - active_effect_duration +

      + active_effect_duration + - instance-attribute -

      -
      active_effect_duration = 0.2
      +

      +
      active_effect_duration = 0.2
       
      -
      - -

      Amount of time in seconds the button 'press' animation lasts.

      -
      +
      + +

      Amount of time in seconds the button 'press' animation lasts.

      +
      @@ -7239,23 +7774,23 @@

      - label +

      + label + - - instance-attribute class-attribute + instance-attribute -

      -
      label: reactive[TextType] = label
      +

      +
      label = label
       
      -
      - -

      The text label that appears within the button.

      -
      +
      + +

      The text label that appears within the button.

      +
    @@ -7263,23 +7798,23 @@

    -

    - variant +

    + variant + - - instance-attribute class-attribute + instance-attribute -

    -
    variant = variant
    +
    +
    variant = variant
     
    -
    - -

    The variant name for the button.

    -
    +
    + +

    The variant name for the button.

    +
    @@ -7288,26 +7823,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.

    - + + + + +
    @@ -7321,22 +7861,22 @@

    -

    - button +

    + button + - instance-attribute -

    -
    button: Button = button
    +
    +
    button = button
     
    -
    - -

    The button that was pressed.

    -
    +
    + +

    The button that was pressed.

    +
    @@ -7344,23 +7884,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.

    +
    @@ -7370,7 +7910,7 @@

    -
    +
    @@ -7378,451 +7918,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.

    +
    + + + + -
    +
    @@ -7830,7 +8495,7 @@

    -
    + @@ -7839,14 +8504,19 @@

    - textual.widgets.button + textual.widgets.button

    -
    +
    + + + + + + -
    @@ -7861,24 +8531,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.

    -
    +
    @@ -7888,7 +8558,7 @@

    -
    +
    diff --git a/widgets/checkbox/index.html b/widgets/checkbox/index.html index d276ab233f..f8c0cc832e 100644 --- a/widgets/checkbox/index.html +++ b/widgets/checkbox/index.html @@ -4115,35 +4115,125 @@
  • - textual.widgets.Checkbox +  Checkbox
  • - + - Changed +  label -
  • + +
  • + + +  value + + + +
  • + +
  • + + +  button_first + + + +
  • + +
  • + + +  name + + + +
  • + +
  • + + +  id + + + +
  • + +
  • + + +  classes + + + +
  • + +
  • + + +  disabled + + + +
  • + +
  • + + +  tooltip + + + +
  • + +
  • + + +  Changed + + + +