summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-03-04 14:32:32 -0600
committerJeff Carr <[email protected]>2025-03-04 14:32:32 -0600
commit84b9b5023289154ffbc918acfbbea620c6069f4c (patch)
treee4ec3f02e1b4bc9024dbcf67e2fc98cddd8305ab
parent5432544a4dc5e72e11c6c461c70a44d78433e560 (diff)
deprecate guipb.Window
-rw-r--r--table.go38
1 files changed, 19 insertions, 19 deletions
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()