Hi all, I need to know wich row in a tree view is under the cursor while a drag operation occur,
These piece of code works great if the tree view as the header hide, if the header is visible
then gtk_tree_view_get_path_at_pos return a wrong value (because the header is counted as the firs row).
Is this a bug or I missed something?
Thanks
DaveMDS


gboolean on_drag_motion (GtkWidget *widget, GdkDragContext *drag_context, gint x, gint y, guint time, gpointer user_data){
GtkTreeModel *model = gtk_tree_view_get_model(widget);
GtkTreePath *path = NULL;
GtkTreeIter iter;


//Get path at pos
gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget), x, y, &path, NULL, NULL, NULL);
//Get iter at path
gtk_tree_model_get_iter (model, &iter, path);
//Get data
gtk_tree_model_get( model, &iter, 6, &mafile,-1);
gtk_tree_path_free(path);


   return TRUE;
}
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to