Am Dienstag, den 20.09.2005, 20:05 +0200 schrieb Nicolas Cormier:
> I have a Treeview and I want to active the EnterNotifyEvent when a the
> user's cursor is on a row.
> 
> I active the EnterNotifyEvent for the treeview but it works only for
> the entire of the widget.

See [1] for a patch against Nautilus which does what you want.

The interesting thing you have to grasp is

a) you only have motion notify events inside a tree view widget
b) you'll have to check what path is active on each motion event
c) the algorithm you can use to detect changes to the hover path, inside
the motion notification handler, where the GdkEventMotion is event, is:

GtkTreePath *hover_path;
GtkTreePath *last_hover_path;

/*  last_hover_path = foo->stored_path; fetch last hover path */
  gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
                                 event->x, event->y,
                                 &hover_path,
                                 NULL, NULL, NULL);
/*  foo->stored_path = hover_path; write back new hover path */

  if (!(last_hover_path == NULL && hover_path == NULL) &&
      (!(last_hover_path != NULL && hover_path != NULL) ||
        gtk_tree_path_compare (last_hover_path, hover_path) != NULL)) {
    /* do whatever you want with the new hover path */
  }

[1] http://bugzilla.gnome.org/attachment.cgi?id=49082&action=view

-- 
Christian Neumair <[EMAIL PROTECTED]>
_______________________________________________
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