Problem with gtk_tree_view_get_path_at_pos
- From: DaveMDS <list gurumeditation it>
- To: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Problem with gtk_tree_view_get_path_at_pos
- Date: Tue, 12 Apr 2005 02:34:13 +0200
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]