summaryrefslogtreecommitdiff
path: root/box.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 /box.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 'box.go')
-rw-r--r--box.go48
1 files changed, 24 insertions, 24 deletions
diff --git a/box.go b/box.go
index 4a16469..03b843f 100644
--- a/box.go
+++ b/box.go
@@ -4,39 +4,39 @@ import (
"go.wit.com/gui/widget"
)
-func (parent *Node) NewBox(name string, b bool) *Node {
- newNode := parent.newNode(name, widget.Box)
+func (parent *Node) NewBox(progname string, b bool) *Node {
+ newNode := parent.newNode(progname, widget.Box)
+ newNode.progname = progname
- if ! newNode.hidden {
- a := newAction(newNode, widget.Add)
- if b {
- a.Direction = widget.Horizontal
- } else {
- a.Direction = widget.Vertical
- }
- sendAction(a)
+ if b {
+ newNode.direction = widget.Horizontal
+ } else {
+ newNode.direction = widget.Vertical
}
+
+ // inform the toolkits
+ sendAction(newNode, widget.Add)
return newNode
}
-func (parent *Node) NewHorizontalBox(name string) *Node {
- newNode := parent.newNode(name, widget.Box)
+func (parent *Node) NewHorizontalBox(progname string) *Node {
+ newNode := parent.newNode(progname, widget.Box)
+ newNode.progname = progname
- if ! newNode.hidden {
- a := newAction(newNode, widget.Add)
- a.Direction = widget.Horizontal
- sendAction(a)
- }
+ newNode.direction = widget.Horizontal
+
+ // inform the toolkits
+ sendAction(newNode, widget.Add)
return newNode
}
-func (parent *Node) NewVerticalBox(name string) *Node {
- newNode := parent.newNode(name, widget.Box)
+func (parent *Node) NewVerticalBox(progname string) *Node {
+ newNode := parent.newNode(progname, widget.Box)
+ newNode.progname = progname
- if ! newNode.hidden {
- a := newAction(newNode, widget.Add)
- a.Direction = widget.Vertical
- sendAction(a)
- }
+ newNode.direction = widget.Vertical
+
+ // inform the toolkits
+ sendAction(newNode, widget.Add)
return newNode
}