diff options
| author | Jeff Carr <[email protected]> | 2024-01-08 21:19:42 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-08 21:19:42 -0600 |
| commit | 02d1d9e50cab6cde6d2096efdd94756b0ba37ec6 (patch) | |
| tree | 806b141c91fb2bc69cdeb8efe58b2965f4f592b0 /andlabs/add.go | |
| parent | 3c2da3f096a5e8aeaa657deb2dc047cc23118c99 (diff) | |
moved to 'go.wit.com/log'
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'andlabs/add.go')
| -rw-r--r-- | andlabs/add.go | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/andlabs/add.go b/andlabs/add.go index a902608..589ecc6 100644 --- a/andlabs/add.go +++ b/andlabs/add.go @@ -4,15 +4,16 @@ import ( "github.com/andlabs/ui" _ "github.com/andlabs/ui/winmanifest" + "go.wit.com/log" "go.wit.com/gui/widget" ) func actionDump(b bool, a *widget.Action) { - log(b, "actionDump() Widget.Type =", a.ActionType) - log(b, "actionDump() Widget.S =", a.S) - log(b, "actionDump() Widget.I =", a.I) - log(b, "actionDump() WidgetId =", a.WidgetId) - log(b, "actionDump() ParentId =", a.ParentId) + log.Log(NOW, "actionDump() Widget.Type =", a.ActionType) + log.Log(NOW, "actionDump() Widget.S =", a.S) + log.Log(NOW, "actionDump() Widget.I =", a.I) + log.Log(NOW, "actionDump() WidgetId =", a.WidgetId) + log.Log(NOW, "actionDump() ParentId =", a.ParentId) } func add(a *widget.Action) { @@ -67,7 +68,7 @@ func add(a *widget.Action) { p.newImage(n) return default: - log(debugError, "add() error TODO: ", n.WidgetType, n.Name) + log.Log(ERROR, "add() error TODO: ", n.WidgetType, n.Name) } } @@ -96,21 +97,21 @@ func add(a *widget.Action) { // -- (0,1) -- (1,1) -- (1,1) -- // ----------------------------- func (p *node) place(n *node) bool { - log(logInfo, "place() START", n.WidgetType, n.Name) + log.Log(INFO, "place() START", n.WidgetType, n.Name) if (p.tk == nil) { - log(logError, "p.tk == nil", p.Name, p.ParentId, p.WidgetType, p.tk) - log(logError, "n = ", n.Name, n.ParentId, n.WidgetType, n.tk) + log.Log(ERROR, "p.tk == nil", p.Name, p.ParentId, p.WidgetType, p.tk) + log.Log(ERROR, "n = ", n.Name, n.ParentId, n.WidgetType, n.tk) panic("p.tk == nil") } - log(logInfo, "place() switch", p.WidgetType) + log.Log(INFO, "place() switch", p.WidgetType) switch p.WidgetType { case widget.Grid: - log(logInfo, "place() Grid try at Parent X,Y =", n.X, n.Y) + log.Log(INFO, "place() Grid try at Parent X,Y =", n.X, n.Y) n.tk.gridX = n.AtW - 1 n.tk.gridY = n.AtH - 1 - log(logInfo, "place() Grid try at gridX,gridY", n.tk.gridX, n.tk.gridY) + log.Log(INFO, "place() Grid try at gridX,gridY", n.tk.gridX, n.tk.gridY) // at the very end, subtract 1 from X & Y since andlabs/ui starts counting at zero p.tk.uiGrid.Append(n.tk.uiControl, n.tk.gridX, n.tk.gridY, 1, 1, @@ -119,7 +120,7 @@ func (p *node) place(n *node) bool { case widget.Group: if (p.tk.uiBox == nil) { p.tk.uiGroup.SetChild(n.tk.uiControl) - log(logInfo, "place() hack Group to use this as the box?", n.Name, n.WidgetType) + log.Log(INFO, "place() hack Group to use this as the box?", n.Name, n.WidgetType) p.tk.uiBox = n.tk.uiBox } else { p.tk.uiBox.Append(n.tk.uiControl, stretchy) @@ -127,23 +128,23 @@ func (p *node) place(n *node) bool { return true case widget.Tab: if (p.tk.uiTab == nil) { - log(logError, "p.tk.uiTab == nil for n.WidgetId =", n.WidgetId, "p.tk =", p.tk) + log.Log(ERROR, "p.tk.uiTab == nil for n.WidgetId =", n.WidgetId, "p.tk =", p.tk) panic("p.tk.uiTab == nil") } if (n.tk.uiControl == nil) { - log(logError, "n.tk.uiControl == nil for n.WidgetId =", n.WidgetId, "n.tk =", n.tk) + log.Log(ERROR, "n.tk.uiControl == nil for n.WidgetId =", n.WidgetId, "n.tk =", n.tk) panic("n.tk.uiControl == nil") } - log(logError, "CHECK LOGIC ON THIS. APPENDING directly into a window without a tab") - // log(logError, "THIS SHOULD NEVER HAPPEN ??????? trying to place() node=", n.WidgetId, n.Name, n.Text, n.WidgetType) - // log(logError, "THIS SHOULD NEVER HAPPEN ??????? trying to place() on parent=", p.WidgetId, p.Name, p.Text, p.WidgetType) + log.Log(ERROR, "CHECK LOGIC ON THIS. APPENDING directly into a window without a tab") + // log.Log(ERROR, "THIS SHOULD NEVER HAPPEN ??????? trying to place() node=", n.WidgetId, n.Name, n.Text, n.WidgetType) + // log.Log(ERROR, "THIS SHOULD NEVER HAPPEN ??????? trying to place() on parent=", p.WidgetId, p.Name, p.Text, p.WidgetType) // panic("n.tk.uiControl == nil") p.tk.uiTab.Append(n.Text, n.tk.uiControl) p.tk.boxC += 1 return true case widget.Box: - log(logInfo, "place() uiBox =", p.tk.uiBox) - log(logInfo, "place() uiControl =", n.tk.uiControl) + log.Log(INFO, "place() uiBox =", p.tk.uiBox) + log.Log(INFO, "place() uiControl =", n.tk.uiControl) p.tk.uiBox.Append(n.tk.uiControl, stretchy) p.tk.boxC += 1 return true @@ -151,7 +152,7 @@ func (p *node) place(n *node) bool { p.tk.uiWindow.SetChild(n.tk.uiControl) return true default: - log(debugError, "place() how? Parent =", p.WidgetId, p.WidgetType) + log.Log(ERROR, "place() how? Parent =", p.WidgetId, p.WidgetType) } return false } |
