Re: [gtk-list] Double Click Event
- From: Tim Janik <Tim Janik Hamburg Netsurf DE>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Double Click Event
- Date: Fri, 9 Jan 1998 01:31:36 +0100 (CET)
On Thu, 8 Jan 1998, Drizzt wrote:
>
>
> How can I catch a Double CLick event in a List Widget?.
hm, seems to become an FAQ, i have posted this before ;)
define a signal handler:
gint
signal_handler_event (GtkWidget *widget,
GdkEventButton *event,
gpointer func_data)
{
if (GTK_IS_LIST_ITEM(widget) &&
( event->type==GDK_2BUTTON_PRESS ||
event->type==GDK_3BUTTON_PRESS) ) {
printf("list item: i feel %s clicked on button %d\n",
event->type==GDK_2BUTTON_PRESS ? "double" : "triple",
event->button);
}
return FALSE;
}
and connect the handler to your object:
{
... list, listitem etc. init stuff
gtk_signal_connect (GTK_OBJECT(list_item),
"button_press_event",
GTK_SIGNAL_FUNC(signal_handler_event),
NULL);
/* and/or */
gtk_signal_connect (GTK_OBJECT(list_item),
"button_release_event",
GTK_SIGNAL_FUNC(signal_handler_event),
NULL);
... something else...
}
>
> Thanks in advance
> Drizzt
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]