summaryrefslogtreecommitdiff
path: root/gocui/plugin.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-17 23:39:03 -0600
committerJeff Carr <[email protected]>2024-01-17 23:39:03 -0600
commita0baba0821441d9cf38f0b33fe12fb96925c6236 (patch)
tree2aece2a890c66c36b08524e117753817078ee58c /gocui/plugin.go
parentbee272651ad38453aef27f098513f7be652c39bf (diff)
new paths
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gocui/plugin.go')
-rw-r--r--gocui/plugin.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/gocui/plugin.go b/gocui/plugin.go
index 3a122e3..c0a925f 100644
--- a/gocui/plugin.go
+++ b/gocui/plugin.go
@@ -3,20 +3,20 @@ package main
import (
// if you include more than just this import
// then your plugin might be doing something un-ideal (just a guess from 2023/02/27)
+ "go.wit.com/lib/widget"
"go.wit.com/log"
- "go.wit.com/gui/widget"
)
func action(a *widget.Action) {
log.Log(INFO, "action() START", a.WidgetId, a.ActionType, a.WidgetType, a.ProgName)
n := me.rootNode.findWidgetId(a.WidgetId)
var w *guiWidget
- if (n != nil) {
+ if n != nil {
w = n.tk
}
switch a.ActionType {
case widget.Add:
- if (w == nil) {
+ if w == nil {
n := addNode(a)
// w = n.tk
n.addWidget()
@@ -37,7 +37,7 @@ func action(a *widget.Action) {
log.Log(NOW, "TODO: set flag here", a.ActionType, a.WidgetType, a.ProgName)
log.Log(NOW, "TODO: n.WidgetType =", n.WidgetType, "n.progname =", a.ProgName)
} else {
- if (a.Value == nil) {
+ if a.Value == nil {
log.Log(ERROR, "TODO: Set here. a == nil id =", a.WidgetId, "type =", a.WidgetType, "Name =", a.ProgName)
log.Log(ERROR, "TODO: Set here. id =", a.WidgetId, "n.progname =", n.progname)
} else {
@@ -74,7 +74,7 @@ func action(a *widget.Action) {
}
func (n *node) AddText(text string) {
- if (n == nil) {
+ if n == nil {
log.Log(NOW, "widget is nil")
return
}
@@ -87,7 +87,7 @@ func (n *node) AddText(text string) {
func (n *node) SetText(text string) {
var changed bool = false
- if (n == nil) {
+ if n == nil {
log.Log(NOW, "widget is nil")
return
}
@@ -95,11 +95,11 @@ func (n *node) SetText(text string) {
n.value = text
changed = true
}
- if (! changed) {
+ if !changed {
return
}
- if (n.Visible()) {
+ if n.Visible() {
n.textResize()
n.deleteView()
n.showView()
@@ -111,7 +111,7 @@ func (n *node) Set(val any) {
log.Log(INFO, "Set() value =", val)
n.value = val
- if (n.WidgetType != widget.Checkbox) {
+ if n.WidgetType != widget.Checkbox {
n.setCheckbox(val)
}
}