List/Table Work
This commit is contained in:
8
table.go
8
table.go
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user