summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/main.go b/main.go
index 9e186b4..b125e96 100644
--- a/main.go
+++ b/main.go
@@ -14,7 +14,6 @@ func main() {
myGui = gui.New().Default()
helloworld()
- // hellosmart()
// This is just a optional goroutine to watch that things are alive
gui.Watchdog()
@@ -26,18 +25,27 @@ func helloworld() {
win.Box().NewButton("hello", func () {
log.Println("world")
+ hellosmart()
})
}
// This creates a window
func hellosmart() {
- myGui = gui.New().Default()
win := smartwindow.New()
+ win.SetParent(myGui)
+ win.InitWindow()
win.Title("helloworld golang wit/gui window")
win.Vertical()
- win.Draw()
+ win.SetDraw(smartDraw)
+ win.Make()
win.Box().NewButton("hello", func () {
- log.Println("world")
+ log.Println("smart")
+ })
+}
+
+func smartDraw(sw *smartwindow.SmartWindow) {
+ sw.Box().NewButton("hello", func () {
+ log.Println("smart")
})
}