summaryrefslogtreecommitdiff
path: root/gocui/common.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/common.go
parentbee272651ad38453aef27f098513f7be652c39bf (diff)
new paths
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gocui/common.go')
-rw-r--r--gocui/common.go40
1 files changed, 20 insertions, 20 deletions
diff --git a/gocui/common.go b/gocui/common.go
index 3c67133..267277f 100644
--- a/gocui/common.go
+++ b/gocui/common.go
@@ -12,8 +12,8 @@ package main
*/
import (
+ "go.wit.com/lib/widget"
"go.wit.com/log"
- "go.wit.com/gui/widget"
)
// this is the channel we send user events like
@@ -24,20 +24,20 @@ var callback chan widget.Action
var pluginChan chan widget.Action
type node struct {
- parent *node
+ parent *node
children []*node
- WidgetId int // widget ID
- WidgetType widget.WidgetType
- ParentId int // parent ID
+ WidgetId int // widget ID
+ WidgetType widget.WidgetType
+ ParentId int // parent ID
- state widget.State
+ state widget.State
// a reference name for programming and debuggign. Must be unique
- progname string
+ progname string
// the text used for button labesl, window titles, checkbox names, etc
- label string
+ label string
// horizontal means layout widgets like books on a bookshelf
// vertical means layout widgets like books in a stack
@@ -51,20 +51,20 @@ type node struct {
strings []string
// This is used for things like a slider(0,100)
- X int
- Y int
+ X int
+ Y int
// This is for the grid size & widget position
- W int
- H int
- AtW int
- AtH int
+ W int
+ H int
+ AtW int
+ AtH int
vals []string // dropdown menu items
// horizontal bool `default:false`
- hasTabs bool // does the window have tabs?
+ hasTabs bool // does the window have tabs?
currentTab bool // the visible tab
// the internal plugin toolkit structure
@@ -75,7 +75,7 @@ type node struct {
// searches the binary tree for a WidgetId
func (n *node) findWidgetId(id int) *node {
- if (n == nil) {
+ if n == nil {
return nil
}
@@ -85,7 +85,7 @@ func (n *node) findWidgetId(id int) *node {
for _, child := range n.children {
newN := child.findWidgetId(id)
- if (newN != nil) {
+ if newN != nil {
return newN
}
}
@@ -93,7 +93,7 @@ func (n *node) findWidgetId(id int) *node {
}
func (n *node) doUserEvent() {
- if (callback == nil) {
+ if callback == nil {
log.Log(ERROR, "doUserEvent() callback == nil", n.WidgetId)
return
}
@@ -196,12 +196,12 @@ func addNode(a *widget.Action) *node {
n.tk = initWidget(n)
// n.tk = new(guiWidget)
- if (a.WidgetType == widget.Root) {
+ if a.WidgetType == widget.Root {
log.Log(INFO, "addNode() Root")
return n
}
- if (me.rootNode.findWidgetId(a.WidgetId) != nil) {
+ if me.rootNode.findWidgetId(a.WidgetId) != nil {
log.Log(ERROR, "addNode() WidgetId already exists", a.WidgetId)
return me.rootNode.findWidgetId(a.WidgetId)
}