diff options
| author | Jeff Carr <[email protected]> | 2025-04-30 14:40:23 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-04-30 14:40:23 -0500 |
| commit | d5e557190de2e2147f3335309f6ea4b66e72be4f (patch) | |
| tree | 17c8a3b6069d1750368e1e94adf8742b18ef02a3 /table.go | |
| parent | 65a18185792e92029eeb85dac79f6f63781fd042 (diff) | |
it is a tree, but the variable shouldn't be this
Diffstat (limited to 'table.go')
| -rw-r--r-- | table.go | 36 |
1 files changed, 7 insertions, 29 deletions
@@ -10,36 +10,9 @@ import ( "go.wit.com/log" "go.wit.com/widget" "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/wrapperspb" ) -/* -// makes a grid inside an existing Widget -func (n *Node) NewTable(title string) *NodeTable { - t := new(NodeTable) - - t.grid = n.RawGrid().SetProgName("PB GRID") - - t.tb = t.grid.newNode(title, widget.Table) - t.tb.label = title - - return t -} - -type NodeColumn struct { - Title string - Vals []string -} - -type NodeTable struct { - grid *Node - tb *Node - Custom func() -} - -func (parent *Node) ShowTableCallback(pb *guipb.Table, f func(id int)) { -} -*/ - func (n *Node) findInTablePB(pb *guipb.Table, id int) *guipb.Widget { if n.tablepb == nil { log.Info("SOMETHING WAS WRONG. gui.findInTablePB() n.tablepb == nil for widget id", id) @@ -331,7 +304,12 @@ func (parent *Node) makeTableGrid(pb *guipb.Table) *Node { pbwidget := new(guipb.Widget) pbwidget.Id = int64(label.id) - pbwidget.Size = v + anyValue, err := anypb.New(wrapperspb.Int64(v)) + if err != nil { + log.Info("gui: failed to add time", err) + continue + } + pbwidget.Val = anyValue r.Widgets = append(r.Widgets, pbwidget) // log.Info("gui: added new int", pbwidget) } |
