diff options
Diffstat (limited to 'andlabs/tab.go')
| -rw-r--r-- | andlabs/tab.go | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/andlabs/tab.go b/andlabs/tab.go index 078ab40..77e8443 100644 --- a/andlabs/tab.go +++ b/andlabs/tab.go @@ -1,6 +1,7 @@ package main import ( + "go.wit.com/log" "go.wit.com/gui/widget" "github.com/andlabs/ui" @@ -23,24 +24,24 @@ func (p *node) newTab(n *node) { var newt *guiWidget if (p == nil) { - log(debugError, "newTab() p == nil. how the fuck does this happen?", n.WidgetId, n.ParentId) + log.Log(ERROR, "newTab() p == nil. how the fuck does this happen?", n.WidgetId, n.ParentId) } if (p.WidgetType != widget.Window) { - log(debugError, "newTab() uiWindow == nil. I can't add a toolbar without window", n.WidgetId, n.ParentId) + log.Log(ERROR, "newTab() uiWindow == nil. I can't add a toolbar without window", n.WidgetId, n.ParentId) return } t := p.tk - log(debugToolkit, "newTab() START", n.WidgetId, n.ParentId) + log.Log(TOOLKIT, "newTab() START", n.WidgetId, n.ParentId) if (t.uiTab == nil) { // this means you have to make a new tab - log(debugToolkit, "newTab() GOOD. This should be the first tab:", n.WidgetId, n.ParentId) + log.Log(TOOLKIT, "newTab() GOOD. This should be the first tab:", n.WidgetId, n.ParentId) newt = rawTab(t.uiWindow, n.Text) t.uiTab = newt.uiTab } else { // this means you have to append a tab - log(debugToolkit, "newTab() GOOD. This should be an additional tab:", n.WidgetId, n.ParentId) + log.Log(TOOLKIT, "newTab() GOOD. This should be an additional tab:", n.WidgetId, n.ParentId) if (n.WidgetType == widget.Tab) { // andlabs doesn't have multiple tab widgets so make a fake one? // this makes a guiWidget internal structure with the parent values @@ -61,19 +62,19 @@ func (p *node) newTab(n *node) { func tabSetMargined(tab *ui.Tab, b bool) { c := tab.NumPages() for i := 0; i < c; i++ { - log(debugToolkit, "SetMargined", i, b) + log.Log(TOOLKIT, "SetMargined", i, b) tab.SetMargined(i, b) } } func rawTab(w *ui.Window, name string) *guiWidget { var newt guiWidget - log(debugToolkit, "rawTab() START", name) + log.Log(TOOLKIT, "rawTab() START", name) if (w == nil) { - log(debugError, "UiWindow == nil. I can't add a tab without a window") - log(debugError, "UiWindow == nil. I can't add a tab without a window") - log(debugError, "UiWindow == nil. I can't add a tab without a window") + log.Log(ERROR, "UiWindow == nil. I can't add a tab without a window") + log.Log(ERROR, "UiWindow == nil. I can't add a tab without a window") + log.Log(ERROR, "UiWindow == nil. I can't add a tab without a window") // sleep(1) return nil } @@ -82,19 +83,19 @@ func rawTab(w *ui.Window, name string) *guiWidget { w.SetChild(tab) newt.uiTab = tab newt.uiControl = tab - log(debugToolkit, "rawTab() END", name) + log.Log(TOOLKIT, "rawTab() END", name) return &newt } func (t *guiWidget) appendTab(name string) *guiWidget { var newT guiWidget - log(debugToolkit, "appendTab() ADD", name) + log.Log(TOOLKIT, "appendTab() ADD", name) if (t.uiTab == nil) { - log(debugToolkit, "UiWindow == nil. I can't add a widget without a place to put it") + log.Log(TOOLKIT, "UiWindow == nil. I can't add a widget without a place to put it") panic("should never have happened. wit/gui/toolkit has ui.Tab == nil") } - log(debugToolkit, "appendTab() START name =", name) + log.Log(TOOLKIT, "appendTab() START name =", name) var hbox *ui.Box if (defaultBehavior) { |
