From a88937c508d2921aa5e6fa335450ee8f05e7fbf9 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 4 Mar 2025 14:33:39 -0600 Subject: working on delete table --- table.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'table.go') 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) { -- cgit v1.2.3