Started working on TUI

This commit is contained in:
2026-01-08 18:56:38 +00:00
parent 8d1e7c962f
commit 54e1f3b424
7 changed files with 350 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
// Package dom
package dom
import (
"github.com/rivo/tview"
)
type UINode struct {
ID string
Self tview.Primitive
Parent tview.Primitive
Children map[string]*UINode
}
func newUINode(ID string, parent, root tview.Primitive) *UINode {
return &UINode{
ID: ID,
Self: root,
Children: make(map[string]*UINode),
}
}
func (l *UINode) AppendItem(item *UINode) error {
// Its not necessary to verify if this ID is already a child of this Node
// because we do that at the UI level
l.Children[item.ID] = item
return nil
}