parent
a8ba47f1d2
commit
c753a839fc
16
main.go
16
main.go
|
@ -14,7 +14,6 @@ func main() {
|
||||||
myGui = gui.New().Default()
|
myGui = gui.New().Default()
|
||||||
|
|
||||||
helloworld()
|
helloworld()
|
||||||
// hellosmart()
|
|
||||||
|
|
||||||
// This is just a optional goroutine to watch that things are alive
|
// This is just a optional goroutine to watch that things are alive
|
||||||
gui.Watchdog()
|
gui.Watchdog()
|
||||||
|
@ -26,18 +25,27 @@ func helloworld() {
|
||||||
|
|
||||||
win.Box().NewButton("hello", func () {
|
win.Box().NewButton("hello", func () {
|
||||||
log.Println("world")
|
log.Println("world")
|
||||||
|
hellosmart()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// This creates a window
|
// This creates a window
|
||||||
func hellosmart() {
|
func hellosmart() {
|
||||||
myGui = gui.New().Default()
|
|
||||||
win := smartwindow.New()
|
win := smartwindow.New()
|
||||||
|
win.SetParent(myGui)
|
||||||
|
win.InitWindow()
|
||||||
win.Title("helloworld golang wit/gui window")
|
win.Title("helloworld golang wit/gui window")
|
||||||
win.Vertical()
|
win.Vertical()
|
||||||
win.Draw()
|
win.SetDraw(smartDraw)
|
||||||
|
win.Make()
|
||||||
|
|
||||||
win.Box().NewButton("hello", func () {
|
win.Box().NewButton("hello", func () {
|
||||||
log.Println("world")
|
log.Println("smart")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func smartDraw(sw *smartwindow.SmartWindow) {
|
||||||
|
sw.Box().NewButton("hello", func () {
|
||||||
|
log.Println("smart")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue