summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
Diffstat (limited to 'table.go')
-rw-r--r--table.go30
1 files changed, 22 insertions, 8 deletions
diff --git a/table.go b/table.go
index ee2eb94..df499b8 100644
--- a/table.go
+++ b/table.go
@@ -53,14 +53,27 @@ func RefreshTime(t *time.Duration) {
}
*/
-func NewTable(title string) *NodeTable {
+// shortcut. makes a window with just a grid in it
+func NewTableWindow(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
+ t.tb = me.rootNode.newNode(title, widget.Table)
+ t.tb.label = title
+
+ return t
+}
+
+// makes a grid inside an existing Widget
+func (n *Node) NewTable(title string) *NodeTable {
+ t := new(NodeTable)
+
+ t.grid = n.RawGrid()
+
+ t.tb = t.grid.newNode(title, widget.Table)
+ t.tb.label = title
return t
}
@@ -71,8 +84,9 @@ type NodeColumn struct {
}
type NodeTable struct {
- n *Node
- // pb *guipb.Table
+ grid *Node
+ tb *Node
+ Custom func()
}
func ShowTable(pb *guipb.Table) {
@@ -130,7 +144,7 @@ func makeTableWidgets(pb *guipb.Table) {
pbwidget.Id = int64(label.id)
pbwidget.Name = v
r.Widgets = append(r.Widgets, pbwidget)
- log.Info("gui: added new string", pbwidget)
+ // log.Info("gui: added new string", pbwidget)
}
}
@@ -144,7 +158,7 @@ func makeTableWidgets(pb *guipb.Table) {
pbwidget.Id = int64(label.id)
pbwidget.Size = v
r.Widgets = append(r.Widgets, pbwidget)
- log.Info("gui: added new int", pbwidget)
+ // log.Info("gui: added new int", pbwidget)
}
}
@@ -163,7 +177,7 @@ func makeTableWidgets(pb *guipb.Table) {
}
pbwidget.Val = anyValue
r.Widgets = append(r.Widgets, pbwidget)
- log.Info("gui: added new val", pbwidget)
+ // log.Info("gui: added new val", pbwidget)
}
}
}