summaryrefslogtreecommitdiff
path: root/button.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 /button.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 'button.go')
-rw-r--r--button.go25
1 files changed, 2 insertions, 23 deletions
diff --git a/button.go b/button.go
index 463a776..9ccff89 100644
--- a/button.go
+++ b/button.go
@@ -8,28 +8,7 @@ func (parent *Node) NewButton(name string, custom func()) *Node {
newNode.value = name
newNode.progname = name
- if ! newNode.hidden {
- a := newAction(newNode, widget.Add)
- sendAction(a)
- }
+ // inform the toolkits
+ sendAction(newNode, widget.Add)
return newNode
}
-
-// find widget by number
-func (n *Node) FindId(i int) (*Node) {
- if (n == nil) {
- return nil
- }
-
- if (n.id == i) {
- return n
- }
-
- for _, child := range n.children {
- newN := child.FindId(i)
- if (newN != nil) {
- return newN
- }
- }
- return nil
-}