Python tkinter Todo App Example

small GUI host using CompositeVM rows and RelayCommand-driven todo actions

Python tkinter Todo App Example small GUI host using CompositeVM rows and RelayCommand-driven todo actions Python tkinter Todo App Example small GUI host using CompositeVM rows and RelayCommand-driven todo actions Host and adapter boundary VMx-owned application state Verification and modeling rule tkinter window entry + listbox button callbacks display required View callbacks button -> command selection -> VM render from VM list User gestures events become VM calls no domain state in host render from VM snapshots Run surface local example command smoke-friendly path documented README entry MainWindowViewModel CompositeVM[TodoItemVM] add_command remove_command TodoItemVM rows ComponentVMOf[TodoItem] toggle_done command row projection RelayCommand add remove toggle complete TodoItem title done flag simple payload Import + run headless import check uv run python -m todo_app display-gated UI Best-fit use Use this when a small Python UI needs VMx collection ownership without a heavier TUI stack. Reading rule Follow arrows top to bottom: host input becomes VMx commands; VMx state publishes renderable projections back to the host. binds routes runs owns projects executes loads children commands data tests boundary

Composite fit

  • Todo rows are homogeneous and selectable.
  • CompositeVM is a better fit than manual list state.

Thin host

  • tkinter callbacks translate gestures to commands.
  • The VM owns collection mutations.

Contrast

  • The C# WPF Todo app uses wrappers for toolkit idiom.
  • Both preserve VMx command ownership.