parent
5f65b2f5ed
commit
fc6bde460c
14
window.go
14
window.go
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue