From 84b9b5023289154ffbc918acfbbea620c6069f4c Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 4 Mar 2025 14:32:32 -0600 Subject: deprecate guipb.Window --- table.go | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'table.go') diff --git a/table.go b/table.go index 387070f..1e2b64a 100644 --- a/table.go +++ b/table.go @@ -35,12 +35,16 @@ type NodeTable struct { Custom func() } -/* -func ShowTable(pb *guipb.Table) { +func (parent *Node) ShowTable(pb *guipb.Table) { // make a new action and populate the current node state + // this should be parent and not rootNode? a := getNewAction(me.rootNode, widget.Show) - makeTableWidgets(pb) + pb.Parent = new(guipb.Widget) + pb.Parent.Id = int64(parent.id) + pb.Parent.Name = pb.Title + + makeTableGrid(pb) nt := guipb.NewTables() nt.Append(pb) @@ -49,22 +53,14 @@ func ShowTable(pb *guipb.Table) { log.Info("unmarshal error", err) return } - log.Info("send action to plugin", "pb len =", len(a.TablePB)) + log.Info("NewStable() send action to plugin", "pb len =", len(a.TablePB)) sendActionToPlugin(a) - } -*/ - -func (parent *Node) ShowTable(pb *guipb.Table) { - // make a new action and populate the current node state - // this should be parent and not rootNode? - a := getNewAction(me.rootNode, widget.Show) - pb.Parent = new(guipb.Widget) - pb.Parent.Id = int64(parent.id) - pb.Parent.Name = pb.Title +func (parent *Node) UpdateTable(pb *guipb.Table) { + a := getNewAction(parent, widget.Show) - makeTableGrid(pb) + log.Info("gui.UpdateTable() TODO: move the widget update val logic here instead of tree") nt := guipb.NewTables() nt.Append(pb) @@ -73,25 +69,28 @@ func (parent *Node) ShowTable(pb *guipb.Table) { log.Info("unmarshal error", err) return } - log.Info("NewStable() send action to plugin", "pb len =", len(a.TablePB)) sendActionToPlugin(a) } -func (parent *Node) UpdateTable(pb *guipb.Table) { +func (parent *Node) DeleteTable(pb *guipb.Table) { a := getNewAction(parent, widget.Show) - log.Info("gui.UpdateTable() TODO: move the widget update val logic here instead of tree") + log.Info("gui.DeleteTable()") nt := guipb.NewTables() - nt.Append(pb) + emptypb := new(guipb.Table) + emptypb.Uuid = pb.Uuid + nt.Append(emptypb) a.TablePB, err = nt.Marshal() if err != nil { log.Info("unmarshal error", err) return } + sendActionToPlugin(a) } +/* func makeTableWidgets(pb *guipb.Table) { if pb == nil { log.Info("pb was nil") @@ -108,6 +107,7 @@ func makeTableWidgets(pb *guipb.Table) { makeTableGrid(pb) } +*/ func makeTableGrid(pb *guipb.Table) { grid := addNode() -- cgit v1.2.3