diff options
Diffstat (limited to 'plugin.go')
| -rw-r--r-- | plugin.go | 31 |
1 files changed, 12 insertions, 19 deletions
@@ -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) |
