1 Commits

Author SHA1 Message Date
celex 80d06c653d list tasks in textual 2026-05-18 16:46:52 +02:00
2 changed files with 14 additions and 2 deletions
+2
View File
@@ -21,6 +21,8 @@ class Database:
if is_new_database:
self.initialize_table()
for i in range(0, 15):
self.create_task(f"task{i}", bool(i%2))
def initialize_table(self):
self.cur.execute("CREATE TABLE tasks(title TEXT, is_done INTEGER)")
+12 -2
View File
@@ -1,9 +1,19 @@
from textual.app import App, ComposeResult
from textual.widgets import Header
from textual.widgets import Header, Checkbox
from textual.containers import VerticalScroll
from .database import Database
class ChoreManagerTui(App):
def __init__(self):
super().__init__()
self.database = Database("DEBUG")
def compose(self) -> ComposeResult:
yield Header()
tasks = self.database.get_all_tasks()
with VerticalScroll():
for task in tasks:
yield Checkbox(task.title, task.is_done)