summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2021-10-05 05:52:50 -0500
committerJeff Carr <[email protected]>2021-10-05 05:52:50 -0500
commit7b96064dfae25ef283c37bd9f2f73652356fe081 (patch)
treed5c85e919b82fb1e707661ec3d3f4324a6145fa4 /structs.go
parentd97801b41e6c4d702b3781383cf79fb7505d66d8 (diff)
DEBUG: gui to debug windows
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go24
1 files changed, 16 insertions, 8 deletions
diff --git a/structs.go b/structs.go
index 50784fa..cc1a421 100644
--- a/structs.go
+++ b/structs.go
@@ -105,12 +105,12 @@ func (s GuiBox) SetTitle(title string) {
return
}
-func (s GuiBox) InitTab(title string) {
+func (s GuiBox) InitTab(title string) *ui.Tab {
if (s.Window == nil) {
- return
+ return nil
}
if (s.Window.UiWindow == nil) {
- return
+ return nil
}
window := s.Window.UiWindow
@@ -123,19 +123,21 @@ func (s GuiBox) InitTab(title string) {
// tab.SetMargined(1, true)
s.Window.UiTab = tab
+ return tab
}
-func (s GuiBox) AddTab(title string, custom ui.Control) {
+func (s GuiBox) AddTab(title string, custom ui.Control) *ui.Tab {
if (s.Window == nil) {
- return
+ return nil
}
if (s.Window.UiTab == nil) {
- return
+ return nil
}
tab := s.Window.UiTab
tab.Append(title, custom)
+ return tab
}
func (s GuiBox) AddTab2(title string, custom ui.Control) *ui.Tab {
@@ -153,8 +155,8 @@ func (s GuiBox) AddTab2(title string, custom ui.Control) *ui.Tab {
func (s GuiBox) AddBoxTab(title string) *GuiBox {
uiTab := s.AddTab2(title, InitBlankWindow())
-
tabSetMargined(uiTab)
+
var box *GuiBox
box = HardBox(s.Window, Xaxis, "jcarrAddBoxTab")
box.Window.UiTab = uiTab
@@ -162,7 +164,13 @@ func (s GuiBox) AddBoxTab(title string) *GuiBox {
}
func (s GuiBox) AddDemoTab(title string) {
- s.AddTab(title, makeWindowTemplate())
+ uiTab := s.AddTab(title, makeWindowTemplate())
+ tabSetMargined(uiTab)
+}
+
+func (s GuiBox) AddDebugTab(title string) {
+ uiTab := s.AddTab(title, makeWindowDebug())
+ tabSetMargined(uiTab)
}
func tabSetMargined(tab *ui.Tab) {