2024-01-19 12:39:25 -06:00
|
|
|
// This window, when it's hidden, still exists to the application
|
|
|
|
// so it can be treated as if it really exists
|
2024-01-18 19:29:02 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-01-19 00:34:15 -06:00
|
|
|
"go.wit.com/gui"
|
2024-01-18 21:20:07 -06:00
|
|
|
"go.wit.com/lib/gadgets"
|
2024-01-19 00:34:15 -06:00
|
|
|
"go.wit.com/log"
|
2024-01-18 19:29:02 -06:00
|
|
|
)
|
|
|
|
|
2024-01-19 00:34:15 -06:00
|
|
|
var apple *gui.Node
|
|
|
|
|
2024-01-18 19:29:02 -06:00
|
|
|
// This initializes the first window, a group and a button
|
2024-01-18 21:20:07 -06:00
|
|
|
func makebasicWindow() *gadgets.BasicWindow {
|
2024-01-18 19:29:02 -06:00
|
|
|
log.Warn("start basicWindow")
|
2024-02-29 17:30:23 -06:00
|
|
|
basicWindow = gadgets.RawBasicWindow("basic window test")
|
2024-01-18 19:29:02 -06:00
|
|
|
basicWindow.Make()
|
2024-01-18 21:20:07 -06:00
|
|
|
basicWindow.StandardClose()
|
2024-01-19 00:34:15 -06:00
|
|
|
basicWindow.Custom = func() {
|
2024-01-18 21:20:07 -06:00
|
|
|
log.Warn("got to close")
|
|
|
|
}
|
2024-01-18 19:29:02 -06:00
|
|
|
|
|
|
|
box1 := basicWindow.Box()
|
|
|
|
group1 := box1.NewGroup("choices")
|
2024-01-19 00:34:15 -06:00
|
|
|
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")
|
|
|
|
})
|
2024-01-18 21:20:07 -06:00
|
|
|
return basicWindow
|
2024-01-18 19:29:02 -06:00
|
|
|
}
|