summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
Diffstat (limited to 'table.go')
-rw-r--r--table.go22
1 files changed, 13 insertions, 9 deletions
diff --git a/table.go b/table.go
index 97bc81d..a6f31e6 100644
--- a/table.go
+++ b/table.go
@@ -13,7 +13,8 @@ import (
"go.wit.com/widget"
)
-func initWindowPB(pb *guipb.Widget) *guiWidget {
+/*
+func initGridPB(pb *guipb.Widget) *guiWidget {
var w *guiWidget
w = new(guiWidget)
@@ -24,6 +25,7 @@ func initWindowPB(pb *guipb.Widget) *guiWidget {
w.labelN = pb.Name
return w
}
+*/
func initGridPB(pb *guipb.Widget) *guiWidget {
var w *guiWidget
@@ -42,19 +44,21 @@ func showTable(t *guipb.Table) {
return
}
log.Info("gocui: table.Title", t.Title)
- if t.Window == nil {
- log.Info("gocui: missing window widget. tree plugin error")
- return
- }
- log.Info("gocui: need to add window here id =", t.Window.Id, t.Window.Name)
+ // log.Info("gocui: need to add window here id =", t.Window.Id, t.Window.Name)
if t.Grid == nil {
log.Info("gocui: missing grid widget. tree plugin error")
return
}
+ root := me.treeRoot.TK.(*guiWidget)
+ parent := root.findWidgetById(int(t.Parent.Id))
+ if parent == nil {
+ log.Info("gocui: show table error. parent.Id not found", t.Parent.Id)
+ return
+ }
+
log.Info("gocui: need to add grid here id =", t.Grid.Id)
- win := initWindowPB(t.Window)
- grid := initWindowPB(t.Window)
- grid.parent = win
+ grid := initGridPB(t.Grid)
+ grid.parent = parent
}
func enableWidget(n *tree.Node) {