diff options
| author | Jeff Carr <[email protected]> | 2024-01-11 19:10:24 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-11 19:10:24 -0600 |
| commit | 3b258d0ce0e20ffedf8804409a16abbe84f1d383 (patch) | |
| tree | 0273746324f274f5c95e96a32b06911f4dd40e05 /nocui | |
| parent | c4582b0b30e3020a92baf299572d8617872d45e5 (diff) | |
var value any
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'nocui')
| -rw-r--r-- | nocui/action.go | 6 | ||||
| -rw-r--r-- | nocui/common.go | 6 | ||||
| -rw-r--r-- | nocui/event.go | 8 | ||||
| -rw-r--r-- | nocui/main.go | 2 | ||||
| -rw-r--r-- | nocui/stdin.go | 2 | ||||
| -rw-r--r-- | nocui/widget.go | 6 |
6 files changed, 15 insertions, 15 deletions
diff --git a/nocui/action.go b/nocui/action.go index babfa6f..892bd54 100644 --- a/nocui/action.go +++ b/nocui/action.go @@ -70,7 +70,7 @@ func (n *node) Delete() { case widget.Grid: // t.uiGrid.SetPadded(true) case widget.Box: - log.Log(NOW, "tWidget.boxC =", p.Name) + log.Log(NOW, "tWidget.boxC =", p.progname) log.Log(NOW, "is there a tParent parent? =", p.parent) // this didn't work: // tWidget.uiControl.Disable() @@ -84,7 +84,7 @@ func (n *node) Delete() { func doAction(a *widget.Action) { log.Log(INFO, "doAction() START a.ActionType =", a.ActionType) - log.Log(INFO, "doAction() START a.S =", a.S) + log.Log(INFO, "doAction() START a.ProgName =", a.ProgName) if (a.ActionType == widget.InitToolkit) { // TODO: make sure to only do this once @@ -125,7 +125,7 @@ func doAction(a *widget.Action) { case widget.GetText: switch a.WidgetType { case widget.Textbox: - a.S = n.S + a.Value = n.value } case widget.Set: // n.setText(a.S) diff --git a/nocui/common.go b/nocui/common.go index cd5b7f1..bd7b145 100644 --- a/nocui/common.go +++ b/nocui/common.go @@ -34,10 +34,10 @@ type node struct { WidgetType widget.WidgetType ParentId int // parent ID - // Name string - // Text string - + // a reference name for programming and debuggign. Must be unique progname string + + // the text used for button labesl, window titles, checkbox names, etc label string // horizontal means layout widgets like books on a bookshelf diff --git a/nocui/event.go b/nocui/event.go index 4de0e32..97f2aed 100644 --- a/nocui/event.go +++ b/nocui/event.go @@ -24,7 +24,7 @@ func (n *node) doWidgetClick() { // n.placeWidgets() // n.toggleTree() case widget.Checkbox: - if (n.B) { + if widget.GetBool(n.value) { // n.setCheckbox(false) } else { // n.setCheckbox(true) @@ -36,10 +36,10 @@ func (n *node) doWidgetClick() { // n.showWidgets() case widget.Box: // n.showWidgetPlacement(logNow, "drawTree()") - if (n.B) { - log.Log(NOW, "BOX IS HORIZONTAL", n.Name) + if widget.GetBool(n.value) { + log.Log(NOW, "BOX IS HORIZONTAL", n.progname) } else { - log.Log(NOW, "BOX IS VERTICAL", n.Name) + log.Log(NOW, "BOX IS VERTICAL", n.progname) } case widget.Button: n.doUserEvent() diff --git a/nocui/main.go b/nocui/main.go index 363c893..f6cfb3b 100644 --- a/nocui/main.go +++ b/nocui/main.go @@ -14,7 +14,7 @@ func catchActionChannel() { log.Log(NOW, "catchActionChannel() for loop") select { case a := <-pluginChan: - log.Log(NOW, "catchActionChannel() SELECT widget id =", a.WidgetId, a.Name) + log.Log(NOW, "catchActionChannel() SELECT widget id =", a.WidgetId, a.ProgName) log.Log(NOW, "catchActionChannel() STUFF", a.WidgetId, a.ActionType, a.WidgetType) muAction.Lock() doAction(&a) diff --git a/nocui/stdin.go b/nocui/stdin.go index 6aa75f5..f7469c6 100644 --- a/nocui/stdin.go +++ b/nocui/stdin.go @@ -56,7 +56,7 @@ func (n *node) showButtons() { } func (n *node) dumpWidget(pad string) { - log.Log(NOW, "node:", pad, n.WidgetId, ",", n.WidgetType, ",", n.Name) + log.Log(NOW, "node:", pad, n.WidgetId, ",", n.WidgetType, ",", n.progname) } var depth int = 0 diff --git a/nocui/widget.go b/nocui/widget.go index c749c4b..6e50705 100644 --- a/nocui/widget.go +++ b/nocui/widget.go @@ -19,10 +19,10 @@ func initWidget(n *node) *guiWidget { } if (n.WidgetType == widget.Box) { - if (n.B) { - n.horizontal = true + if (n.direction == widget.Horizontal) { + // n.horizontal = true } else { - n.horizontal = false + // n.horizontal = false } } |
