Re: CList event problems



On Mon, May 21, 2001 at 09:51:57AM -0600, rhfreeman wrote:
> More GTK oddities for you folks....
> 
> I've got this clist which I call using:
> 
>   gtk_signal_connect(GTK_OBJECT(signal_lists), "button_press_event",
> GTK_SIGNAL_FUNC(clist_select), GINT_TO_POINTER(number));
> 
> I would prefer to use "select_row" signal but it won't work with a right
> mouse button event so this will have to do!
> 
> static void clist_select(GtkWidget *list, GdkEventButton *event, gpointer
> data)
> {
>   gint row, column;
> // snip
>   gtk_clist_get_selection_info(GTK_CLIST(list), event->x, event->y, &row,
> &column);
> // do other stuff
> }
> 
> The problem with that method is that when I click and drag the CLIST column
> title to alter the width of the widget it also registers it as a click on
> row 0. I've not found a way to find a difference between a click on the
> resize bar and normal click on the clist itself.
> 
> Obviously, I'd like to find a way to tell them apart! GDK_BUTTON1_MASK might
> help but I'm not exactly sure how to use it!
> 
> Thanks for the help!
> 
> Rich

Try using 'gtk_clist_set_button_action'. With this you can say which buttons
have which effect on the CList. Be aware you have to give this function the
number of the mouse button minus one (left button: 0, middle button: 1,
right button: 2).

Hope this helps

Rolf Schaeuble




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