Re: [gtk-list] Re: Clists -- double click or no



>    Thank you.  I found the column width after sending the message.  I have one more
>  question that I wasn't able to find easily I am afraid and forgot to ask with my last
>  post.  How can you differentiate between buttons?  Is it similar to detecting double
>  click?  I noticed testgtk on clist test seems to think they are the same button (only
>  a two button mouse, didn't try the hacked 3 button concept).  Also, can you force it
>  to know the difference between single and double, or only know when it was a double?

Take a look at the GdkEvent* structures.  If you have a plain
GdkEvent, you can use something like this:

	GdkEvent *event;

	...

	switch (event->type) {
	case GDK_BUTTON_PRESS:
		printf ("Single click of button %d\n", event->button.button);
		break;

	case GDK_2BUTTON_PRESS:
		printf ("Double click of button %d\n", event->button.button);
		break;

	case GDK_3BUTTON_PRESS:
		printf ("Triple click of button %d\n", event->button.button);
		break;

	default:
		printf ("Other event\n");
	}

Good luck,

  Quartic



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