minor updates

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-06-03 23:17:13 -07:00
parent 5f65b2f5ed
commit fc6bde460c
1 changed files with 10 additions and 4 deletions

View File

@ -7,11 +7,12 @@ import "time"
import "github.com/andlabs/ui" import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest" import _ "github.com/andlabs/ui/winmanifest"
func InitGuiWindow(action string, gw *GuiWindow) *GuiWindow { func InitGuiWindow(name string, gw *GuiWindow) *GuiWindow {
log.Println("InitGuiWindow() START") log.Println("InitGuiWindow() START")
var newGuiWindow GuiWindow var newGuiWindow GuiWindow
newGuiWindow.Width = Config.Width newGuiWindow.Width = Config.Width
newGuiWindow.Height = Config.Height newGuiWindow.Height = Config.Height
newGuiWindow.Name = name
newGuiWindow.MakeWindow = gw.MakeWindow newGuiWindow.MakeWindow = gw.MakeWindow
newGuiWindow.UiWindow = gw.UiWindow newGuiWindow.UiWindow = gw.UiWindow
newGuiWindow.UiTab = gw.UiTab newGuiWindow.UiTab = gw.UiTab
@ -20,6 +21,12 @@ func InitGuiWindow(action string, gw *GuiWindow) *GuiWindow {
newGuiWindow.EntryMap["test"] = nil 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
if (Data.buttonMap == nil) { if (Data.buttonMap == nil) {
GuiInit() GuiInit()
} }
@ -28,12 +35,11 @@ func InitGuiWindow(action string, gw *GuiWindow) *GuiWindow {
} }
func StartNewWindow(bg bool, action string, callback func(*GuiWindow) *GuiBox) { func StartNewWindow(bg bool, name string, callback func(*GuiWindow) *GuiBox) {
log.Println("StartNewWindow() Create a new window") log.Println("StartNewWindow() Create a new window")
var junk GuiWindow var junk GuiWindow
junk.MakeWindow = callback junk.MakeWindow = callback
// junk.Action = action window := InitGuiWindow(name, &junk)
window := InitGuiWindow(action, &junk)
if (bg) { if (bg) {
log.Println("StartNewWindow() START NEW GOROUTINE for ui.Main()") log.Println("StartNewWindow() START NEW GOROUTINE for ui.Main()")
go ui.Main(func() { go ui.Main(func() {