Re: Right mouse clicks


Paul Davis <pbd op net> writes:

> >And until that is implemented, what's the easiest suggested way to
> >handle such clicks for a TreeView for example?
> i don't really know why you feel this way:
>   gint button_release_handler (GdkEventButton *event) 
>   {
>      switch (event->button) { 
>      case 1:
>          printf ("button 1 (probably left) was clicked\n");
> 	 break;
>      case 2:
>          printf ("button 2 (probably middle) was clicked\n");
> 	 break;
>      case 3:
>          printf ("button 3 (probably right) was clicked\n");
> 	 break;
>      default:
>          printf ("button %d was clicked\n", event->button);
> 	 break;
>      }
>      return TRUE;
>    }	 

I don't think connecting to button_release is sufficient to reliably
detect a mouse-click. You'd want to connect to "button_press" as well
and assure that the release comes from the same window as the last
press. This is the method GTK+ uses when emitting "clicked" signals.
Jarek probably asked for similar signals for middle and right mouse
button clicks.

Salut, Sven

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