Re: [gtk-list] ctree right-click question




GnomeICU does this (http://gnomeicu.gdev.net/) in a hackish way; I'm sure
better ways exist.  When I add the row, I set data on that row with
gtk_clist_set_row_data.  Then when a click is detected, I do:

gint icq_sendmessage_window( GtkWidget *clist, GdkEventButton *event,
                             gpointer data)
{
...
/* This detects where the mouse click took place */
  gtk_clist_get_selection_info( GTK_CLIST( clist ), event->x, event->y,
                                &row, &column );

/* This gets the data that was stored in the clicked row, in this case,
   the user's UIN */
 uin = GPOINTER_TO_INT(gtk_clist_get_row_data( GTK_CLIST( clist ),row ) );
...
}


Now you have a way to uniquely identify each row, and then figure out
which row was clicked.  For the entire code, look in gtkfunc.c in
GnomeICU, for the above function, or let me know if you need more
assistance.

Sincerely,

Jeremy Wise

+----------------------------------------------------------------+
| Jeremy Wise                       Make every effort to enter   |
| jwise@pathwaynet.com              through the narrow door,     |
| ICQ #4664755                      because many, I tell you,    |
| http://www.pathwaynet.com/~jwise  will try to enter and will   |
| http://gnomeicu.gdev.net/         not be able to. (Luke 13:24) |
+----------------------------------------------------------------+

On Thu, 5 Aug 1999 gandalf@pobox.com wrote:

> 
> 
> I'm using the ctree widget, and would like to make use of the right mouse
> button.  What I want to do is select a row and have a popup window come
> up.  Now getting the popup menu to appear when I right click is easy, the
> problem I am having is in selecting the ctree row.  Is there anyway to
> determine which row the mouse is "over"?
> 
> Thanks
> -chris
> 
> _______________________________________________________
> Christopher Rogers      http://www.pobox.com/~gandalf
> gandalf@pobox.com       gandalf@darkcorner.net
> 
> 
> -- 
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null
> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]