summaryrefslogtreecommitdiff
path: root/structs.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2021-10-04 21:54:16 -0500
committerJeff Carr <[email protected]>2021-10-04 21:54:16 -0500
commite5b4e184fc20e13e4744ea7b3a46d57055460864 (patch)
tree2d83f56cfbf85e7b1d29505740b701258166894d /structs.go
parentb5b1528a29d42d01597cb15b317177ca2237e535 (diff)
TAB: more tab handling cleanups
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'structs.go')
-rw-r--r--structs.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/structs.go b/structs.go
index fa7c42c..a48f1c0 100644
--- a/structs.go
+++ b/structs.go
@@ -124,7 +124,7 @@ func (s GuiBox) InitTab(title string) {
s.Window.UiTab = tab
}
-func (s GuiBox) AddTab(title string) {
+func (s GuiBox) AddTab(title string, custom ui.Control) {
if (s.Window == nil) {
return
}
@@ -134,7 +134,20 @@ func (s GuiBox) AddTab(title string) {
tab := s.Window.UiTab
- tab.Append(title, InitBlankWindow())
+ tab.Append(title, custom)
+}
+
+func (s GuiBox) AddDemoTab(title string) {
+ if (s.Window == nil) {
+ return
+ }
+ if (s.Window.UiTab == nil) {
+ return
+ }
+
+ tab := s.Window.UiTab
+
+ tab.Append(title, makeWindowTemplate())
}
// Note: every mouse click is handled