summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--table.go39
1 files changed, 31 insertions, 8 deletions
diff --git a/table.go b/table.go
index 6d9b145..35d64c9 100644
--- a/table.go
+++ b/table.go
@@ -52,23 +52,46 @@ func RefreshTime(t *time.Duration) {
}
*/
+func NewTable(title string) *NodeTable {
+ t := new(NodeTable)
+ /*
+ t.pb = new(guipb.Table)
+ t.pb.Title = title
+ */
+ t.n = me.rootNode.newNode(title, widget.Table)
+ t.n.label = title
+
+ return t
+}
+
+type NodeColumn struct {
+ Title string
+ Vals []string
+}
+
type NodeTable struct {
- n *Node
- pb *guipb.Table
+ n *Node
+ // pb *guipb.Table
}
-func (t *NodeTable) ShowTable() {
+func (t *NodeTable) ShowTable(pb *guipb.Table) {
+ log.Info("gui.ShowTable")
// make a new action and populate the current node state
a := getNewAction(t.n, widget.Show)
- if t.pb == nil {
- log.Info("error: TablePB == nil")
- return
- }
- a.TablePB, err = t.pb.Marshal()
+ /*
+ if t.pb == nil {
+ log.Info("error: TablePB == nil")
+ return
+ }
+ */
+ nt := guipb.NewTables()
+ nt.Append(pb)
+ a.TablePB, err = nt.Marshal()
if err != nil {
log.Info("unmarshal error", err)
return
}
+ log.Info("send action to plugin", t.n.label, "pb len =", len(a.TablePB))
sendActionToPlugin(a)
/*