blob: 742fb9a6f552aa2fbb558b092a129b2330adaecb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// 11 december 2015
package ui
import "testing"
func TestIt(t *testing.T) {
err := Main(func() {
w := NewWindow("Hello", 320, 240, false)
w.OnClosing(func(w *Window) bool {
Quit()
return true
})
s := NewGroup("Group")
w.SetChild(s)
w.SetMargined(true)
b := NewButton("Click Me")
b.OnClicked(func(*Button) {
s.SetMargined(!s.Margined())
})
s.SetChild(b)
w.Show()
})
if err != nil {
t.Fatal(err)
}
}
|