diff options
Diffstat (limited to 'nocui/action.go')
| -rw-r--r-- | nocui/action.go | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/nocui/action.go b/nocui/action.go index 19a42b4..babfa6f 100644 --- a/nocui/action.go +++ b/nocui/action.go @@ -1,6 +1,7 @@ package main import ( + "go.wit.com/log" "go.wit.com/gui/widget" ) @@ -28,9 +29,9 @@ func (n *node) pad(at widget.ActionType) { case widget.Grid: case widget.Box: case widget.Textbox: - log(logError, "TODO: implement ActionType =", at) + log.Log(ERROR, "TODO: implement ActionType =", at) default: - log(logError, "TODO: implement pad() for", at) + log.Log(ERROR, "TODO: implement pad() for", at) } } @@ -46,18 +47,18 @@ func (n *node) move(newParent *node) { case widget.Grid: // t.uiGrid.SetPadded(true) case widget.Box: - log(logInfo, "TODO: move() where =", p.ParentId) - log(logInfo, "TODO: move() for widget =", n.WidgetId) + log.Log(INFO, "TODO: move() where =", p.ParentId) + log.Log(INFO, "TODO: move() for widget =", n.WidgetId) default: - log(logError, "TODO: need to implement move() for type =", n.WidgetType) - log(logError, "TODO: need to implement move() for where =", p.ParentId) - log(logError, "TODO: need to implement move() for widget =", n.WidgetId) + log.Log(ERROR, "TODO: need to implement move() for type =", n.WidgetType) + log.Log(ERROR, "TODO: need to implement move() for where =", p.ParentId) + log.Log(ERROR, "TODO: need to implement move() for widget =", n.WidgetId) } } func (n *node) Delete() { p := n.parent - log(logNow, "uiDelete()", n.WidgetId, "to", p.WidgetId) + log.Log(NOW, "uiDelete()", n.WidgetId, "to", p.WidgetId) switch p.WidgetType { case widget.Group: @@ -69,21 +70,21 @@ func (n *node) Delete() { case widget.Grid: // t.uiGrid.SetPadded(true) case widget.Box: - log(logNow, "tWidget.boxC =", p.Name) - log(logNow, "is there a tParent parent? =", p.parent) + log.Log(NOW, "tWidget.boxC =", p.Name) + log.Log(NOW, "is there a tParent parent? =", p.parent) // this didn't work: // tWidget.uiControl.Disable() // sleep(.8) // tParent.uiBox.Append(tWidget.uiControl, stretchy) default: - log(logError, "TODO: need to implement uiDelete() for widget =", n.WidgetId, n.WidgetType) - log(logError, "TODO: need to implement uiDelete() for parent =", p.WidgetId, p.WidgetType) + log.Log(ERROR, "TODO: need to implement uiDelete() for widget =", n.WidgetId, n.WidgetType) + log.Log(ERROR, "TODO: need to implement uiDelete() for parent =", p.WidgetId, p.WidgetType) } } func doAction(a *widget.Action) { - log(logNow, "doAction() START a.ActionType =", a.ActionType) - log(logNow, "doAction() START a.S =", a.S) + log.Log(INFO, "doAction() START a.ActionType =", a.ActionType) + log.Log(INFO, "doAction() START a.S =", a.S) if (a.ActionType == widget.InitToolkit) { // TODO: make sure to only do this once @@ -95,11 +96,11 @@ func doAction(a *widget.Action) { return } - log(logNow, "doAction() START a.WidgetId =", a.WidgetId, "a.ParentId =", a.ParentId) + log.Log(INFO, "doAction() START a.WidgetId =", a.WidgetId, "a.ParentId =", a.ParentId) switch a.WidgetType { case widget.Root: me.rootNode = addNode(a) - log(logNow, "doAction() found rootNode") + log.Log(INFO, "doAction() found rootNode") return case widget.Flag: // flag(&a) @@ -143,11 +144,11 @@ func doAction(a *widget.Action) { case widget.Delete: n.Delete() case widget.Move: - log(logNow, "doAction() attempt to move() =", a.ActionType, a.WidgetType) + log.Log(INFO, "doAction() attempt to move() =", a.ActionType, a.WidgetType) newParent := me.rootNode.findWidgetId(a.ParentId) n.move(newParent) default: - log(logError, "doAction() Unknown =", a.ActionType, a.WidgetType) + log.Log(ERROR, "doAction() Unknown =", a.ActionType, a.WidgetType) } - log(logInfo, "doAction() END =", a.ActionType, a.WidgetType) + log.Log(INFO, "doAction() END =", a.ActionType, a.WidgetType) } |
