Adding upstream version 0.12.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
d887bee5ca
commit
148efc9122
69 changed files with 12923 additions and 0 deletions
36
tests/snapshot_tests/snapshot_apps/data_table_add_column.py
Normal file
36
tests/snapshot_tests/snapshot_apps/data_table_add_column.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
from textual.app import App, ComposeResult
|
||||
from textual.binding import Binding
|
||||
from textual_fastdatatable import ArrowBackend, DataTable
|
||||
|
||||
MOVIES = [
|
||||
"Severance",
|
||||
"Foundation",
|
||||
"Dark",
|
||||
"The Boys",
|
||||
"The Last of Us",
|
||||
"Lost in Space",
|
||||
"Altered Carbon",
|
||||
]
|
||||
|
||||
|
||||
class AddColumn(App):
|
||||
BINDINGS = [
|
||||
Binding(key="c", action="add_column", description="Add Column"),
|
||||
]
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
backend = ArrowBackend.from_pydict({"Movies": MOVIES})
|
||||
table = DataTable(backend=backend)
|
||||
|
||||
column_idx = table.add_column("No Default")
|
||||
table.add_column("With Default", default="ABC")
|
||||
table.add_column("Long Default", default="01234567890123456789")
|
||||
|
||||
# Ensure we can update a cell
|
||||
table.update_cell(2, column_idx, "Hello!")
|
||||
yield table
|
||||
|
||||
|
||||
app = AddColumn()
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
Loading…
Add table
Add a link
Reference in a new issue