summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2021-10-04 23:38:45 -0500
committerJeff Carr <[email protected]>2021-10-04 23:38:45 -0500
commit10292371973f65fda2997eda41e911fc48f45414 (patch)
tree68442a4716c420dbdc9d54f5e473de671e62c6fa /structs.go
parente5b4e184fc20e13e4744ea7b3a46d57055460864 (diff)
ANALABS: work on improving the abstraction
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go22
1 files changed, 18 insertions, 4 deletions
diff --git a/structs.go b/structs.go
index a48f1c0..e5e8520 100644
--- a/structs.go
+++ b/structs.go
@@ -137,17 +137,31 @@ func (s GuiBox) AddTab(title string, custom ui.Control) {
tab.Append(title, custom)
}
-func (s GuiBox) AddDemoTab(title string) {
+func (s GuiBox) AddTab2(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
+}
- tab.Append(title, makeWindowTemplate())
+func (s GuiBox) AddBoxTab(title string) *GuiBox {
+ uiTab := s.AddTab2(title, InitBlankWindow())
+
+ var box *GuiBox
+ box = HardBox(s.Window, Xaxis, "jcarrAddBoxTab")
+ box.Window.UiTab = uiTab
+ return box
+
+}
+
+func (s GuiBox) AddDemoTab(title string) {
+ s.AddTab(title, makeWindowTemplate())
}
// Note: every mouse click is handled