basicwindow/basicWindow.go

41 lines
883 B
Go

// This creates a simple hello world window
package main
import (
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/log"
)
var apple *gui.Node
// This initializes the first window, a group and a button
func makebasicWindow() *gadgets.BasicWindow {
log.Warn("start basicWindow")
basicWindow = gadgets.NewBasicWindow(myGui, "basic window test")
basicWindow.Make()
basicWindow.StandardClose()
basicWindow.Custom = func() {
log.Warn("got to close")
}
box1 := basicWindow.Box()
group1 := box1.NewGroup("choices")
group1.NewButton("hide apple", func() {
apple.Hide()
})
group1.NewButton("show apple", func() {
apple.Show()
})
group1.NewButton("hide computers", func() {
computers.Hide()
})
group1.NewButton("show computers", func() {
computers.Show()
})
apple = group1.NewButton("apple", func() {
log.Info("is not a pear")
})
return basicWindow
}