summaryrefslogtreecommitdiff
path: root/grid.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-13 22:02:12 -0600
committerJeff Carr <[email protected]>2024-01-13 22:02:12 -0600
commit47b15946de10a75cda026a7317a90d4857b453c8 (patch)
treeab6a8c085226263982d3b19f2913e540707af2a1 /grid.go
parent4ef8409eeadcd4a359b7593b5ea35f9f523bfb64 (diff)
work on hiding widgetsv0.12.5
When widgets are hidden, their state works exactly the same as normal, but updates are not sent to the toolkits Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'grid.go')
-rw-r--r--grid.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/grid.go b/grid.go
index d48edcd..7f8747d 100644
--- a/grid.go
+++ b/grid.go
@@ -33,21 +33,20 @@ type GridOffset struct {
Y int
}
-func (n *Node) NewGrid(name string, w int, h int) *Node {
- newNode := n.newNode(name, widget.Grid)
+func (n *Node) NewGrid(progname string, w int, h int) *Node {
+ newNode := n.newNode(progname, widget.Grid)
+ newNode.progname = progname
newNode.W = w
newNode.H = h
newNode.NextW = 1
newNode.NextH = 1
- if ! newNode.hidden {
- a := newAction(newNode, widget.Add)
- sendAction(a)
- }
-
// by default, always pad grids
- newNode.Pad()
+ newNode.pad = true
+
+ // inform the toolkits
+ sendAction(newNode, widget.Add)
return newNode
}