diff --git a/Makefile b/Makefile index d230812..1cd872b 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ all: build + reset ./basicwindow build: diff --git a/basicWindow.go b/basicWindow.go index b4f864a..c763aad 100644 --- a/basicWindow.go +++ b/basicWindow.go @@ -2,19 +2,23 @@ package main import ( - "go.wit.com/lib/gadgets" "go.wit.com/log" + "go.wit.com/lib/gadgets" ) // This initializes the first window, a group and a button -func makebasicWindow() { +func makebasicWindow() *gadgets.BasicWindow { log.Warn("start basicWindow") basicWindow = gadgets.NewBasicWindow(myGui, "basic window test") basicWindow.Make() - basicWindow.StandardExit() + basicWindow.StandardClose() + basicWindow.Custom = func () { + log.Warn("got to close") + } box1 := basicWindow.Box() group1 := box1.NewGroup("choices") group1.NewButton("hello", func() {}) - basicWindow.Draw() + // basicWindow.Draw() + return basicWindow } diff --git a/main.go b/main.go index c1acfde..69c7f06 100644 --- a/main.go +++ b/main.go @@ -18,9 +18,10 @@ var basicWindow *gadgets.BasicWindow func main() { myGui = gui.New().Default() - myGui.LoadToolkit("nocui") + // myGui.LoadToolkit("nocui") helloworld() + basicWindow = makebasicWindow() // go will sit here until the window exits gui.Watchdog() @@ -28,7 +29,7 @@ func main() { // This initializes the first window and some widgets func helloworld() { - mainWindow = myGui.NewWindow("hello world") + mainWindow = myGui.NewWindow("hello world").SetProgName("BASEWIN1") box := mainWindow.NewBox("vbox", false) group := box.NewGroup("choices") @@ -37,7 +38,7 @@ func helloworld() { log.Println("world") }) grid.NewButton("show basic window", func() { - makebasicWindow() + basicWindow.Toggle() }) grid.NewLabel("apple")