summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
Diffstat (limited to 'table.go')
-rw-r--r--table.go36
1 files changed, 7 insertions, 29 deletions
diff --git a/table.go b/table.go
index 0824c34..b9a5cd8 100644
--- a/table.go
+++ b/table.go
@@ -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)
}