2 button press



Hello,

  How can I receive only _one_ double click and triple click event (on
double click I don't want to receive simple click, simple click, double click,
just one double click, and on triple click I don't want to receive
simple click, simple click, double click, simple click, triple click).
  My program (probably wrong) is:

 gint button_press_callback (GtkWidget *widget, GdkEventButton *event)
 {
	if (event->button == 3)
	{
		switch (event->type)
		{
			case GDK_BUTTON_PRESS:
				g_print ("single click\n");
				break;

			case GDK_2BUTTON_PRESS:
				g_print ("double click\n");
				break;

			case GDK_3BUTTON_PRESS:
				g_print ("triple click\n");
				break;

			default:
				break;
		}
	}
	return TRUE;
 }


 Thanks,
   Csabi




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