testing on tables

This commit is contained in:
Jeff Carr 2025-02-18 20:10:26 -06:00
parent fd24d2ee0d
commit 27c9417a32
1 changed files with 31 additions and 0 deletions

View File

@ -10,8 +10,39 @@ import (
"go.wit.com/widget"
)
// repeated string order = 1;
//
// repeated StringRow StringRows = 2;
// repeated IntRow IntRows = 3;
// repeated TimeRow TimeRows = 4;
// repeated BoolRow BoolRows = 5;
func (me *TreeInfo) doTable(a widget.Action) {
if a.TablePB == nil {
log.Log(TREE, "tree: action didn't have a Table PB")
return
}
pb := guipb.NewTables()
if err := pb.Unmarshal(a.TablePB); err != nil {
log.Info("unmarshal error", err, "data len =", len(a.TablePB))
return
}
log.Info("dumpTables:")
all := pb.All()
for all.Scan() {
t := all.Next()
for i, o := range t.Order {
log.Info("got order:", t.Title, i, o)
}
}
}
// everything from the application goes through here
func (me *TreeInfo) doAction(a widget.Action) {
if a.TablePB != nil {
log.Log(TREEWARN, "tree: got a TablePB")
me.doTable(a)
return
}
n := treeRoot.FindWidgetId(a.WidgetId)
switch a.ActionType {
case widget.Add: