diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-06-24 23:40:18 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-06-24 23:40:18 +0800 |
commit | 1ce40d7581bac2b776d1e47ec49c03c0fcc7fdc1 (patch) | |
tree | f7b957645b11bc19ecf7fb29baaa13530557af7a /Godeps/_workspace/src/github.com/obscuren/qml/examples/customtype/customtype.go | |
parent | 92ef33d97a437dce2d7b55f06342de388d95f575 (diff) | |
download | go-tangerine-1ce40d7581bac2b776d1e47ec49c03c0fcc7fdc1.tar go-tangerine-1ce40d7581bac2b776d1e47ec49c03c0fcc7fdc1.tar.gz go-tangerine-1ce40d7581bac2b776d1e47ec49c03c0fcc7fdc1.tar.bz2 go-tangerine-1ce40d7581bac2b776d1e47ec49c03c0fcc7fdc1.tar.lz go-tangerine-1ce40d7581bac2b776d1e47ec49c03c0fcc7fdc1.tar.xz go-tangerine-1ce40d7581bac2b776d1e47ec49c03c0fcc7fdc1.tar.zst go-tangerine-1ce40d7581bac2b776d1e47ec49c03c0fcc7fdc1.zip |
Godeps: remove mist remnants, add termui deps
Diffstat (limited to 'Godeps/_workspace/src/github.com/obscuren/qml/examples/customtype/customtype.go')
-rw-r--r-- | Godeps/_workspace/src/github.com/obscuren/qml/examples/customtype/customtype.go | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/Godeps/_workspace/src/github.com/obscuren/qml/examples/customtype/customtype.go b/Godeps/_workspace/src/github.com/obscuren/qml/examples/customtype/customtype.go deleted file mode 100644 index 1433d6ed8..000000000 --- a/Godeps/_workspace/src/github.com/obscuren/qml/examples/customtype/customtype.go +++ /dev/null @@ -1,48 +0,0 @@ -package main - -import ( - "fmt" - "os" - - "gopkg.in/qml.v1" -) - -func main() { - if err := qml.Run(run); err != nil { - fmt.Fprintf(os.Stderr, "error: %v\n", err) - os.Exit(1) - } -} - -type GoType struct { - Text string -} - -func (v *GoType) SetText(text string) { - fmt.Println("Text changing to:", text) - v.Text = text -} - -type GoSingleton struct { - Event string -} - -func run() error { - qml.RegisterTypes("GoExtensions", 1, 0, []qml.TypeSpec{{ - Init: func(v *GoType, obj qml.Object) {}, - }, { - Init: func(v *GoSingleton, obj qml.Object) { v.Event = "birthday" }, - - Singleton: true, - }}) - - engine := qml.NewEngine() - component, err := engine.LoadFile("customtype.qml") - if err != nil { - return err - } - - value := component.Create(nil) - fmt.Println("Text is:", value.Interface().(*GoType).Text) - return nil -} |