summaryrefslogtreecommitdiff
path: root/plugin.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-05 07:31:04 -0600
committerJeff Carr <[email protected]>2024-02-05 07:31:04 -0600
commitcf72809e26d25380be0e9a05f81c8780f7538d37 (patch)
tree995b536a11fcbb54fbb1dfec753769810bbff927 /plugin.go
parent825be13ee98bff8a981a905afa3a4f6402cf10ca (diff)
use treeNode.Hidden()
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'plugin.go')
-rw-r--r--plugin.go31
1 files changed, 12 insertions, 19 deletions
diff --git a/plugin.go b/plugin.go
index 4c84323..673f184 100644
--- a/plugin.go
+++ b/plugin.go
@@ -7,6 +7,13 @@ import (
"go.wit.com/widget"
)
+/*
+func newaction(n *tree.Node, atype widget.ActionType) {
+ switch a.ActionType {
+ case widget.Add:
+}
+*/
+
func action(a widget.Action) {
log.Log(INFO, "action() START", a.WidgetId, a.ActionType, a.WidgetType, a.ProgName)
// n := me.rootNode.findWidgetId(a.WidgetId)
@@ -34,9 +41,7 @@ func action(a widget.Action) {
} else {
w.setColor(&colorDisabled)
}
- if w.hidden {
- w.SetVisible(false)
- }
+ w.Show()
} else {
// this is done to protect the plugin being 'refreshed' with the
// widget binary tree. TODO: find a way to keep them in sync
@@ -44,23 +49,11 @@ func action(a widget.Action) {
a.WidgetId, a.ActionType, a.WidgetType, a.ProgName)
}
case widget.Show:
- w.node.State.Hidden = false
- if w.Visible() {
- // widget was already shown
- } else {
- log.Log(INFO, "Setting Visible to true", a.ProgName)
- w.SetVisible(true)
- }
+ log.Log(NOW, "Show() HERE. a.Hidden() was =", a.State.Hidden)
+ w.Show()
case widget.Hide:
- w.node.State.Hidden = true
- log.Log(NOW, "HIDE HERE. a.State.Hidden =", a.State.Hidden)
- log.Log(NOW, "HIDE HERE. w.hidden =", w.hidden)
- if w.Visible() {
- log.Log(INFO, "Setting Visible to false", a.ProgName)
- w.SetVisible(false)
- } else {
- // widget was already hidden
- }
+ log.Log(NOW, "Hide() HERE. a.State.Hidden was =", a.State.Hidden)
+ w.Hide()
case widget.Set:
if a.WidgetType == widget.Flag {
log.Log(NOW, "TODO: set flag here", a.ActionType, a.WidgetType, a.ProgName)