Re: Emulate doubleclick in GtkCList?



>can someone tell me, if there is a possibility to get the doubleclick =
>event from an row of the CList.
>It's needed for an own file-browser

of course.

   gtk_signal_connect (GTK_OBJECT(the_clist), "button_press_event",
                       (GtkSignalFunc) my_handler, NULL);

   ....

   gint my_handler (GtkWidget *w, GdkEventButton *ev, gpointer data) 
   {
       gint row, col;

       switch (ev->type) {
       case GDK_2BUTTON_PRESS:
	    gtk_clist_get_selection_info (GTK_CLIST(w), ev->x, ev->y,
					  &row, &col);
            break;					  
       ...

You may want to (conditionally) add:

      gtk_signal_emit_stop_by_signal (w, "button_press_event");

in the handler to prevent the button press(es) from having their usual
effect. Or you may not.

all clear?

oh, and please stop sending HTML formatted email in addition to plain
text email. its wasteful of internet bandwidth and utterly horrible
for those of us who use text-based email software.

--p




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