diff options
| author | Jeff Carr <[email protected]> | 2025-02-21 05:41:54 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-21 05:41:54 -0600 |
| commit | 1cb395d4e29239a6d0c50ff37e16c143844dac75 (patch) | |
| tree | 694038a2b1010e5b045855063e898c64bb71a725 /table.go | |
| parent | f41728a81b2dec47cb826fab2acdaf2b9829f2f7 (diff) | |
start thinking about a raw grid widgetv0.22.29
Diffstat (limited to 'table.go')
| -rw-r--r-- | table.go | 30 |
1 files changed, 22 insertions, 8 deletions
@@ -53,14 +53,27 @@ func RefreshTime(t *time.Duration) { } */ -func NewTable(title string) *NodeTable { +// shortcut. makes a window with just a grid in it +func NewTableWindow(title string) *NodeTable { t := new(NodeTable) /* t.pb = new(guipb.Table) t.pb.Title = title */ - t.n = me.rootNode.newNode(title, widget.Table) - t.n.label = title + t.tb = me.rootNode.newNode(title, widget.Table) + t.tb.label = title + + return t +} + +// makes a grid inside an existing Widget +func (n *Node) NewTable(title string) *NodeTable { + t := new(NodeTable) + + t.grid = n.RawGrid() + + t.tb = t.grid.newNode(title, widget.Table) + t.tb.label = title return t } @@ -71,8 +84,9 @@ type NodeColumn struct { } type NodeTable struct { - n *Node - // pb *guipb.Table + grid *Node + tb *Node + Custom func() } func ShowTable(pb *guipb.Table) { @@ -130,7 +144,7 @@ func makeTableWidgets(pb *guipb.Table) { pbwidget.Id = int64(label.id) pbwidget.Name = v r.Widgets = append(r.Widgets, pbwidget) - log.Info("gui: added new string", pbwidget) + // log.Info("gui: added new string", pbwidget) } } @@ -144,7 +158,7 @@ func makeTableWidgets(pb *guipb.Table) { pbwidget.Id = int64(label.id) pbwidget.Size = v r.Widgets = append(r.Widgets, pbwidget) - log.Info("gui: added new int", pbwidget) + // log.Info("gui: added new int", pbwidget) } } @@ -163,7 +177,7 @@ func makeTableWidgets(pb *guipb.Table) { } pbwidget.Val = anyValue r.Widgets = append(r.Widgets, pbwidget) - log.Info("gui: added new val", pbwidget) + // log.Info("gui: added new val", pbwidget) } } } |
