diff options
| author | Jeff Carr <[email protected]> | 2019-06-03 15:45:40 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-06-03 15:45:40 -0700 |
| commit | 50c6e6c07d12841370a0830d79a7b74b974a20f8 (patch) | |
| tree | f0f3a0be66223123151ab7faf0b8c71a6ebdfdf4 /gui.go | |
| parent | 6b5c78fbe96b2b23e38267ee0d495440baf113c1 (diff) | |
make a WindowMap to track which windows exist
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gui.go')
| -rw-r--r-- | gui.go | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -12,6 +12,8 @@ const Yaxis = 1 // box that is vertical func GuiInit() { Data.buttonMap = make(map[*ui.Button]*GuiButton) + Data.WindowMap = make(map[string]*GuiWindow) + ui.OnShouldQuit(func() bool { ui.Quit() return true @@ -29,8 +31,16 @@ func InitGuiWindow(name string, gw *GuiWindow) *GuiWindow { newGuiWindow.UiTab = gw.UiTab newGuiWindow.BoxMap = make(map[string]*GuiBox) newGuiWindow.EntryMap = make(map[string]*GuiEntry) - newGuiWindow.EntryMap["test"] = nil - Data.Windows = append(Data.Windows, &newGuiWindow) + Data.Windows = append(Data.Windows, &newGuiWindow) + + if (Data.WindowMap == nil) { + log.Println("gui.InitGuiWindow() making the Data.WindowMap here") + Data.WindowMap = make(map[string]*GuiWindow) + } + Data.WindowMap[name] = &newGuiWindow + + // make a blank entry for testing + // newGuiWindow.EntryMap["test"] = nil if (Data.buttonMap == nil) { GuiInit() |
