On 9/22/05, Christian Neumair <[EMAIL PROTECTED]> wrote: > 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]> > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (GNU/Linux) > > iD8DBQBDMsMFWfvsaU5lO4kRArLwAJ4ntJvOAX1iHpHpFDaE4IW3HZLhfwCfWbPq > aEJFORbT+Kaz4QBG4fYlSNM= > =O4na > -----END PGP SIGNATURE----- > > >
Thanks a lot for your answer. _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list