blob: c1399f88c7984796ef8155ba062f79e3a91a9ce8 (
plain) (
blame)
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
28
29
30
31
32
33
34
35
36
37
|
package main
import (
"fmt"
"gopkg.in/qml.v1"
"os"
)
func main() {
if err := qml.Run(run); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
}
func run() error {
engine := qml.NewEngine()
base, err := engine.LoadFile("base.qml")
if err != nil {
return err
}
rect, err := engine.LoadFile("rect.qml")
if err != nil {
return err
}
win := base.CreateWindow(nil)
obj := rect.Create(nil)
obj.Set("parent", win.Root())
win.Show()
win.Wait()
return nil
}
|