vimsheet.ui.sheet_tabs

Sheet tab strip — rendered inline via Rich Text, scrollable via mouse wheel.

class vimsheet.ui.sheet_tabs.SheetTabs(**kwargs)[source]

Bases: Widget

Horizontal strip of clickable sheet tabs rendered as Rich text.

Parameters:

kwargs (object)

DEFAULT_CSS = '\n    SheetTabs {\n        height: 1;\n        background: $panel;\n    }\n    '

Default TCSS.

class SheetSelected(index)[source]

Bases: Message

Parameters:

index (int)

__init__(index)[source]
Parameters:

index (int)

Return type:

None

time
bubble: ClassVar[bool] = True
handler_name: ClassVar[str] = 'on_sheet_tabs_sheet_selected'

Name of the default message handler.

no_dispatch: ClassVar[bool] = False
verbose: ClassVar[bool] = False
class AddSheet[source]

Bases: Message

time
bubble: ClassVar[bool] = True
handler_name: ClassVar[str] = 'on_sheet_tabs_add_sheet'

Name of the default message handler.

no_dispatch: ClassVar[bool] = False
verbose: ClassVar[bool] = False
__init__(**kwargs)[source]

Initialize a Widget.

Parameters:
  • *children – Child widgets.

  • name – The name of the widget.

  • id – The ID of the widget in the DOM.

  • classes – The CSS classes for the widget.

  • disabled – Whether the widget is disabled or not.

  • markup – Enable content markup?

  • kwargs (object)

Return type:

None

set_palette(palette)[source]
Parameters:

palette (GridPalette)

Return type:

None

set_sheets(names, active)[source]
Parameters:
Return type:

None

render()[source]

Get [content](/guide/content) for the widget.

Implement this method in a subclass for custom widgets.

This method should return [markup](/guide/content#markup), a [Content][textual.content.Content] object, or a [Rich](https://github.com/Textualize/rich) renderable.

Example

```python from textual.app import RenderResult from textual.widget import Widget

class CustomWidget(Widget):
def render(self) -> RenderResult:

return “Welcome to [bold red]Textual[/]!”

```

Returns:

A string or object to render as the widget’s content.

Return type:

Text

on_click(event)[source]
Parameters:

event (Click)

Return type:

None

on_mouse_scroll_down(event)[source]
Parameters:

event (object)

Return type:

None

on_mouse_scroll_up(event)[source]
Parameters:

event (object)

Return type:

None

can_focus = False

Widget may receive focus.

can_focus_children = True

Widget’s children may receive focus.