Double clicking in a clist (yes, I know it has been covered a zil lion times already!!)



Folks,

First the code:

      gtk_signal_connect(GTK_OBJECT(w_layout[number].signal_lists),
"select_row",  GTK_SIGNAL_FUNC(clist_select), GINT_TO_POINTER(number));

static void clist_select(GtkWidget *list, gint row, gint column,
GdkEventButton *event, gpointer data)
{
 // stuff

  if (event->type==GDK_2BUTTON_PRESS) 
  {
    printf("DOUBLE CLICK!\n");
  }
  else
  {
    printf("SINGLE!\n");
  }

  // blah
}

Now, I've got a minor problem. The single click and double click events do
totally different things. What happens is when I first double click a row, I
get a SINGLE click event and then a double click event. From then on when I
double click THAT row, I only get a double click event but when I change to
a different row I get the single click event again first.

I think I need to use gtk_timeout_add() or something like that to help me
here, but I don't know how. Help, I don't want that first SINGLE click event
unless it is a single click - hence the need for a timeout?!?

Thanks in advance for your help!

Rich




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