From 02d1d9e50cab6cde6d2096efdd94756b0ba37ec6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 8 Jan 2024 21:19:42 -0600 Subject: moved to 'go.wit.com/log' Signed-off-by: Jeff Carr --- andlabs/setText.go | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'andlabs/setText.go') diff --git a/andlabs/setText.go b/andlabs/setText.go index ecc1066..1dcb2f2 100644 --- a/andlabs/setText.go +++ b/andlabs/setText.go @@ -1,18 +1,19 @@ package main import ( + "go.wit.com/log" "go.wit.com/gui/widget" ) func (n *node) setText(a *widget.Action) { - log(debugChange, "setText() START with a.S =", a.S) + log.Log(CHANGE, "setText() START with a.S =", a.S) t := n.tk if (t == nil) { - log(debugError, "setText error. tk == nil", n.Name, n.WidgetId) + log.Log(ERROR, "setText error. tk == nil", n.Name, n.WidgetId) actionDump(debugError, a) return } - log(debugChange, "setText() Attempt on", n.WidgetType, "with", a.S) + log.Log(CHANGE, "setText() Attempt on", n.WidgetType, "with", a.S) switch n.WidgetType { case widget.Window: @@ -30,7 +31,7 @@ func (n *node) setText(a *widget.Action) { // TODO: commented out while working on chan t.uiCheckbox.SetChecked(a.B) default: - log(debugError, "setText() unknown", a.ActionType, "on checkbox", n.Name) + log.Log(ERROR, "setText() unknown", a.ActionType, "on checkbox", n.Name) } case widget.Textbox: switch a.ActionType { @@ -49,7 +50,7 @@ func (n *node) setText(a *widget.Action) { t.uiMultilineEntry.SetText(a.S) } default: - log(debugError, "setText() unknown", a.ActionType, "on checkbox", n.Name) + log.Log(ERROR, "setText() unknown", a.ActionType, "on checkbox", n.Name) } case widget.Label: t.uiLabel.SetText(a.S) @@ -62,7 +63,7 @@ func (n *node) setText(a *widget.Action) { case widget.Set: t.uiSlider.SetValue(a.I) default: - log(debugError, "setText() unknown", a.ActionType, "on checkbox", n.Name) + log.Log(ERROR, "setText() unknown", a.ActionType, "on checkbox", n.Name) } case widget.Spinner: switch a.ActionType { @@ -71,7 +72,7 @@ func (n *node) setText(a *widget.Action) { case widget.Set: t.uiSpinbox.SetValue(a.I) default: - log(debugError, "setText() unknown", a.ActionType, "on checkbox", n.Name) + log.Log(ERROR, "setText() unknown", a.ActionType, "on checkbox", n.Name) } case widget.Dropdown: switch a.ActionType { @@ -82,17 +83,17 @@ func (n *node) setText(a *widget.Action) { var i int = -1 var s string orig = t.uiCombobox.Selected() - log(debugChange, "try to set the Dropdown to", a.S, "from", orig) + log.Log(CHANGE, "try to set the Dropdown to", a.S, "from", orig) // try to find the string for i, s = range t.val { - log(debugChange, "i, s", i, s) + log.Log(CHANGE, "i, s", i, s) if (a.S == s) { t.uiCombobox.SetSelected(i) - log(debugChange, "setText() Dropdown worked.", n.S) + log.Log(CHANGE, "setText() Dropdown worked.", n.S) return } } - log(debugError, "setText() Dropdown did not find:", a.S) + log.Log(ERROR, "setText() Dropdown did not find:", a.S) // if i == -1, then there are not any things in the menu to select if (i == -1) { return @@ -106,7 +107,7 @@ func (n *node) setText(a *widget.Action) { case widget.GetText: // t.S = t.s default: - log(debugError, "setText() unknown", a.ActionType, "on checkbox", n.Name) + log.Log(ERROR, "setText() unknown", a.ActionType, "on checkbox", n.Name) } case widget.Combobox: switch a.ActionType { @@ -119,10 +120,10 @@ func (n *node) setText(a *widget.Action) { t.uiEditableCombobox.SetText(a.S) n.S = a.S default: - log(debugError, "setText() unknown", a.ActionType, "on checkbox", n.Name) + log.Log(ERROR, "setText() unknown", a.ActionType, "on checkbox", n.Name) } default: - log(debugError, "plugin Send() Don't know how to setText on", n.WidgetType, "yet", a.ActionType) + log.Log(ERROR, "plugin Send() Don't know how to setText on", n.WidgetType, "yet", a.ActionType) } - log(debugChange, "setText() END with a.S =", a.S) + log.Log(CHANGE, "setText() END with a.S =", a.S) } -- cgit v1.2.3