go-gtk
go-gtk copied to clipboard
panic in example/drawable.go
panic: runtime error: cgo argument has Go pointer to Go pointer
goroutine 1 [running]:
panic(0x58b240, 0xc82000a340)
/usr/lib/go/src/runtime/panic.go:464 +0x3e6
github.com/mattn/go-gtk/gtk._cgoCheckPointer0(0x550dc0, 0xc82000e460, 0xc82000a330, 0x1, 0x1, 0xc82000a2f4)
??:0 +0x4d
github.com/mattn/go-gtk/gtk.Init(0x8c7840)
/home/ecc/go/src/github.com/mattn/go-gtk/gtk/gtk.go:228 +0x3fd
main.main()
/home/ecc/go/src/github.com/mattn/go-gtk/example/drawable/drawable.go:17 +0x2f
exit status 2
go version go1.6 linux/amd64 go-gtk commit ed2d2dd0968823f4d921f471967bb406253d0127
The problem is passing &os.Args to gtk.Init(). When I replace it with gtk.Init(nil), it works fine. Same problem for many of the other example programs.
go-gtk is using that passing pointer of go's pointer. But go1.6 include change to make it panic. So most of features are currently doesn't work.
This is my TODO. If you want to get workaround, please pass nil into gtk.Init.
Any progress on this? Took me couple of hours find the reason why all the examples are broken (doesn't run). I'm running go 1.7.4 on ubuntu 16.04.
You might want to add note to the README.md that if examples doesn't work, try passing nil into gtk.Init.