testing on tables
This commit is contained in:
parent
fd24d2ee0d
commit
27c9417a32
31
action.go
31
action.go
|
@ -10,8 +10,39 @@ import (
|
||||||
"go.wit.com/widget"
|
"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
|
// everything from the application goes through here
|
||||||
func (me *TreeInfo) doAction(a widget.Action) {
|
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)
|
n := treeRoot.FindWidgetId(a.WidgetId)
|
||||||
switch a.ActionType {
|
switch a.ActionType {
|
||||||
case widget.Add:
|
case widget.Add:
|
||||||
|
|
Loading…
Reference in New Issue