Closed jinj closed 4 years ago
I tried to all C.gtk_tree_view_get_path_at_pos function from my go code as:
C.gtk_tree_view_get_path_at_pos(gtk.TREE_VIEW(treeview), C.int(btn.X), C.int(btn.Y), &path.GTreePat h, nil, nil, nil)
and got this error:
cannot use gtk.TREE_VIEW(treeview) (type gtk._Ctype_struct__GtkTreeView) as type _Ctype_struct__GtkTreeView in assignment
So gtk.TRE_VIEW() returns gtk.C.GtkTreeView, not C.GtkTreeView.
What is the correct way to call the function from Go code?
You can not use gtk.TREE_VIEW to pass C API.
gtk.TREE_VIEW
You have to use C casting.
I tried to all C.gtk_tree_view_get_path_at_pos function from my go code as:
C.gtk_tree_view_get_path_at_pos(gtk.TREE_VIEW(treeview), C.int(btn.X), C.int(btn.Y), &path.GTreePat h, nil, nil, nil)
and got this error:
cannot use gtk.TREE_VIEW(treeview) (type gtk._Ctype_struct__GtkTreeView) as type _Ctype_struct__GtkTreeView in assignment
So gtk.TRE_VIEW() returns gtk.C.GtkTreeView, not C.GtkTreeView.
What is the correct way to call the function from Go code?