2022-10-17 12:12:58 -05:00
|
|
|
package gui
|
|
|
|
|
|
|
|
import "log"
|
2022-10-17 15:02:13 -05:00
|
|
|
// import "time"
|
2022-10-20 06:55:42 -05:00
|
|
|
// import toolkit "git.wit.org/wit/gui/toolkit/andlabs"
|
2022-10-17 12:12:58 -05:00
|
|
|
|
|
|
|
func NewStandardWindow(title string) *Node {
|
|
|
|
log.Println("NewStandardWindow() creating", title)
|
|
|
|
|
|
|
|
Config.Title = title
|
|
|
|
Config.Width = 640
|
|
|
|
Config.Height = 480
|
|
|
|
Config.Exit = StandardClose
|
|
|
|
return NewWindow()
|
|
|
|
}
|
2022-10-19 13:23:22 -05:00
|
|
|
|
|
|
|
//
|
|
|
|
// This creates a window that shows how the toolkit works
|
|
|
|
// internally using it's raw unchanged code for the toolkit itself
|
|
|
|
//
|
|
|
|
// This is a way to test and see if the toolkit is working at all
|
|
|
|
// right now it shows the andlabs/ui/DemoNumbersPage()
|
|
|
|
//
|
|
|
|
func DemoToolkitWindow() {
|
2022-10-20 06:55:42 -05:00
|
|
|
var w *Node
|
2022-10-17 12:12:58 -05:00
|
|
|
|
2022-10-17 22:39:03 -05:00
|
|
|
w = NewStandardWindow("Demo of the GUI Toolkit")
|
2022-10-17 12:12:58 -05:00
|
|
|
|
2022-10-20 06:55:42 -05:00
|
|
|
// d = w.New("demo")
|
2022-10-17 12:12:58 -05:00
|
|
|
|
2022-10-20 06:55:42 -05:00
|
|
|
w.toolkit.DemoNumbersPage()
|
|
|
|
/*
|
|
|
|
tk = w.Toolkit.DemoNumbersPage()
|
2022-10-17 15:02:13 -05:00
|
|
|
tk.OnChanged = func(t *toolkit.Toolkit) {
|
|
|
|
log.Println("toolkit.NewSlider() value =", t.Value())
|
|
|
|
if (d.OnChanged != nil) {
|
|
|
|
log.Println("toolkit.Demo() running node.OnChanged")
|
|
|
|
d.OnChanged(d)
|
|
|
|
}
|
2022-10-17 12:12:58 -05:00
|
|
|
}
|
2022-10-17 15:02:13 -05:00
|
|
|
d.Toolkit = tk
|
2022-10-20 06:55:42 -05:00
|
|
|
*/
|
2022-10-17 12:12:58 -05:00
|
|
|
|
|
|
|
log.Println("ToolkitDemoWindow() END")
|
|
|
|
}
|