List/Table Work

This commit is contained in:
2025-07-20 10:28:56 -05:00
parent c152a52304
commit 174fab2c6d
2 changed files with 32 additions and 9 deletions

View File

@@ -45,6 +45,8 @@ type Table struct {
cursorX, cursorY int
wrapColumns bool
border []rune
x, y int
w, h int
wantW, wantH int
@@ -79,6 +81,7 @@ func (w *Table) Init(id string, style tcell.Style) {
w.id = id
w.style = style
w.visible = true
w.border = h.BRD_CSIMPLE
}
func (w *Table) Id() string { return w.id }
func (w *Table) HandleResize(ev *tcell.EventResize) {}
@@ -200,3 +203,8 @@ func (w *Table) Focusable() bool { return w.focusable }
func (w *Table) SetTitle(ttl string) { w.title = ttl }
func (w *Table) SetFocusable(f bool) { w.focusable = f }
func (w *Table) SetBorder(b []rune) { w.border = b }
func (w *Table) AddRow(row []string) { w.data = append(w.data, row) }
func (w *Table) ClearData() { w.data = [][]string{} }
func (w *Table) GetData() [][]string { return w.data }