diff options
| author | Jeff Carr <[email protected]> | 2023-12-14 10:36:56 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-12-14 10:36:56 -0600 |
| commit | 282119d970faed3f8a60d5105a2f26ee14681ff4 (patch) | |
| tree | 1680731c899f0e147487b9ba4d50ace2f3e96eb1 /toolkit/andlabs/tab.go | |
| parent | 9d075afb1df62276dea06be4a188eaee8fc69420 (diff) | |
tabs, windows + gocui dropdown menu (almost)
dropdown menu figures out what text was clicked
dropdown menu movement changes line colors
dropdown menus force user to select a response
accidentally committed a binary
tab selection works
tab and window views almost working
tabs and windows almost working
window widgets selection works
better color handling
using gocui view.Visable flag
removal of old color setting code
still need an artificial delay for andlabs SetText()
catching more 'nil' errors
fixed the stupid duplicate tab problem in andlabs
figured out how andlabs had a tab/box mess
works on more than one domain
builds and runs again
debugging double tabs in andlabs gui
GO111MODULE compile notes
code reorg
further improvements
example cloudflare app does first successful dns update
add NewEntryLine() for single line entry boxes
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'toolkit/andlabs/tab.go')
| -rw-r--r-- | toolkit/andlabs/tab.go | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/toolkit/andlabs/tab.go b/toolkit/andlabs/tab.go index eecebfa..2f44b03 100644 --- a/toolkit/andlabs/tab.go +++ b/toolkit/andlabs/tab.go @@ -23,7 +23,7 @@ func (p *node) newTab(n *node) { var newt *andlabsT if (p.WidgetType != toolkit.Window) { - log(debugToolkit, "newTab() uiWindow == nil. I can't add a toolbar without window", n.WidgetId, n.ParentId) + log(debugError, "newTab() uiWindow == nil. I can't add a toolbar without window", n.WidgetId, n.ParentId) return } t := p.tk @@ -38,7 +38,15 @@ func (p *node) newTab(n *node) { } else { // this means you have to append a tab log(debugToolkit, "newTab() GOOD. This should be an additional tab:", n.WidgetId, n.ParentId) - newt = t.appendTab(n.Text) + if (n.WidgetType == toolkit.Tab) { + // andlabs doesn't have multiple tab widgets so make a fake one? + // this makes a andlabsT internal structure with the parent values + newt = new(andlabsT) + newt.uiWindow = t.uiWindow + newt.uiTab = t.uiTab + } else { + newt = t.appendTab(n.Text) + } } n.tk = newt @@ -63,7 +71,7 @@ func rawTab(w *ui.Window, name string) *andlabsT { 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") - sleep(1) + // sleep(1) return nil } @@ -77,13 +85,13 @@ func rawTab(w *ui.Window, name string) *andlabsT { func (t *andlabsT) appendTab(name string) *andlabsT { var newT andlabsT - log(debugToolkit, "gui.toolkit.NewTab() ADD", name) + log(debugToolkit, "appendTab() ADD", name) if (t.uiTab == nil) { - log(debugToolkit, "gui.Toolkit.UiWindow == nil. I can't add a widget without a place to put it") + log(debugToolkit, "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, "gui.toolkit.AddTab() START name =", name) + log(debugToolkit, "appendTab() START name =", name) var hbox *ui.Box if (defaultBehavior) { @@ -103,12 +111,3 @@ func (t *andlabsT) appendTab(name string) *andlabsT { newT.uiBox = hbox return &newT } - -/* -func newTab(n *node) { - log(logInfo, "newTab() add to parent id:", n.ParentId) - - p := n.parent - p.newTab(n) -} -*/ |
