go-gtk
go-gtk copied to clipboard
4025: cannot use value (type unsafe.Pointer) as type C.gpointer
Debian 64 with Mate gtk installed I this message and I can not go on: go/src/github.com/mattn/go-gtk/gtk/gtk.go:4025: cannot use value (type unsafe.Pointer) as type C.gpointer in argument to _Cfunc_to_GTreePath thank you
what version of go do you use? gccgo?
paolo@paolo:~$ go version go version go1.3.3 linux/amd64
paolo@paolo:~$ gccgo version bash: gccgo: command not found
bits older. But if this fixes your problem, I'll merge this.
diff --git a/gtk/gtk.go b/gtk/gtk.go
index 8b2a3fb..b6fd827 100644
--- a/gtk/gtk.go
+++ b/gtk/gtk.go
@@ -4022,7 +4022,7 @@ func NewTreePathFromString(path string) *TreePath {
return &TreePath{C.gtk_tree_path_new_from_string(gstring(ptr))}
}
func TreePathFromNative(value unsafe.Pointer) *TreePath {
- return &TreePath{C.to_GTreePath(value)}
+ return &TreePath{C.to_GTreePath(C.gpointer(value))}
}
func NewTreePathNewFirst() *TreePath {
return &TreePath{C.gtk_tree_path_new_first()}
I put the local changes and filling I: ../github.com/mattn/go-gtk/gtk/gtk.go:4033:29: expected ';', found 'IDENT' string
4020 func NewTreePathFromString(path string) *TreePath { 4021 return &TreePath{C.gtk_tree_path_new_from_string(gstring(ptr))} 4022 } 4023 4024 func TreePathFromNative(value unsafe.Pointer) *TreePath { 4025 return &TreePath{C.to_GTreePath(C.gpointer(value))} 4026 } 4027 4028 func NewTreePathNewFirst() *TreePath { 4029 return &TreePath{C.gtk_tree_path_new_first()} 4030 4031 // gtk_tree_path_new_from_indices 4032 4033 func (v *TreePath) String() string { 4034 return gostring(C.gtk_tree_path_to_string(v.GTreePath)) 4035 }
Could you please send me pull-request?
I tried to compile the example: go-gtk/example/action/
go 1.3 is too old.
as an example I can try?
Sorry, I don't use go1.3, so I don't know which you can try.