ANALABS: work on improving the abstraction
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
83c19cb614
commit
e6c44cd2d3
22
structs.go
22
structs.go
|
@ -137,17 +137,31 @@ func (s GuiBox) AddTab(title string, custom ui.Control) {
|
||||||
tab.Append(title, custom)
|
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) {
|
if (s.Window == nil) {
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
if (s.Window.UiTab == nil) {
|
if (s.Window.UiTab == nil) {
|
||||||
return
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
tab := s.Window.UiTab
|
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
|
// Note: every mouse click is handled
|
||||||
|
|
|
@ -204,6 +204,11 @@ func CreateBlankWindow(title string, x int, y int) *GuiBox {
|
||||||
newGuiWindow.Name = title
|
newGuiWindow.Name = title
|
||||||
newGuiWindow.UiWindow = window
|
newGuiWindow.UiWindow = window
|
||||||
|
|
||||||
|
newGuiWindow.BoxMap = make(map[string]*GuiBox)
|
||||||
|
newGuiWindow.EntryMap = make(map[string]*GuiEntry)
|
||||||
|
|
||||||
|
Data.WindowMap[newGuiWindow.Name] = &newGuiWindow
|
||||||
|
|
||||||
var box GuiBox
|
var box GuiBox
|
||||||
box.Window = &newGuiWindow
|
box.Window = &newGuiWindow
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue