vimsheet.ui.formula_bar
Formula bar widget — address, formula/value display, mode indicator.
- class vimsheet.ui.formula_bar.FormulaBar(**kwargs)[source]
Bases:
WidgetOne-line bar: [address] [content …] [mode]
- Parameters:
kwargs (object)
- DEFAULT_CSS = '\n FormulaBar {\n height: 1;\n background: $surface;\n color: $text;\n padding: 0;\n }\n FormulaBar Static {\n height: 1;\n background: transparent;\n }\n '
Default TCSS.
- cell_address: reactive[str]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- formula_text: reactive[str]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- cursor_pos: reactive[int]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- mode: reactive[Mode]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- is_modified: reactive[bool]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- is_locked: reactive[bool]
Create a reactive attribute.
- Parameters:
default – A default value or callable that returns a default.
layout – Perform a layout on change.
repaint – Perform a repaint on change.
init – Call watchers on initialize (post mount).
always_update – Call watchers even when the new value equals the old value.
recompose – Compose the widget again when the attribute changes.
bindings – Refresh bindings when the reactive changes.
toggle_class – An optional TCSS classname(s) to toggle based on the truthiness of the value.
- __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
- compose()[source]
Called by Textual to create child widgets.
This method is called when a widget is mounted or by setting
recompose=Truewhen calling [refresh()][textual.widget.Widget.refresh].Note that you don’t typically need to explicitly call this method.
Example
```python def compose(self) -> ComposeResult:
yield Header() yield Label(“Press the button below:”) yield Button() yield Footer()
- Return type:
Iterable[Widget]
- update_cell(address, formula_or_value, locked=False, cursor_pos=-1)[source]
Convenience: update address and content together.
- can_focus = False
Widget may receive focus.
- can_focus_children = True
Widget’s children may receive focus.