summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-19 06:54:36 -0600
committerJeff Carr <[email protected]>2025-02-19 17:39:45 -0600
commitad34230d670a24840a3da54db319d9dd4b0d2479 (patch)
treeb77547a391265569ac9c6a568c98cc837fbf6d8a /table.go
parent57b6efd8315bdb9df1a87439733c83757d993235 (diff)
Diffstat (limited to 'table.go')
-rw-r--r--table.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/table.go b/table.go
index 8e288c5..97bc81d 100644
--- a/table.go
+++ b/table.go
@@ -4,6 +4,7 @@
package main
import (
+ "fmt"
"slices"
"go.wit.com/lib/protobuf/guipb"
@@ -12,12 +13,48 @@ import (
"go.wit.com/widget"
)
+func initWindowPB(pb *guipb.Widget) *guiWidget {
+ var w *guiWidget
+ w = new(guiWidget)
+
+ w.pb = pb
+ w.parent = me.treeRoot.TK.(*guiWidget)
+ w.wtype = widget.Window
+ w.cuiName = fmt.Sprintf("%d %s", pb.Id, "TK")
+ w.labelN = pb.Name
+ return w
+}
+
+func initGridPB(pb *guipb.Widget) *guiWidget {
+ var w *guiWidget
+ w = new(guiWidget)
+
+ w.pb = pb
+ w.wtype = widget.Grid
+ w.cuiName = fmt.Sprintf("%d %s", pb.Id, "TK")
+ w.labelN = pb.Name
+ return w
+}
+
func showTable(t *guipb.Table) {
log.Info("gocui: should show table here")
if t == nil {
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)
+ if t.Grid == nil {
+ log.Info("gocui: missing grid widget. tree plugin error")
+ return
+ }
+ log.Info("gocui: need to add grid here id =", t.Grid.Id)
+ win := initWindowPB(t.Window)
+ grid := initWindowPB(t.Window)
+ grid.parent = win
}
func enableWidget(n *tree.Node) {