Re: [gtkmm] Detecting double-click in a treeview and more



>> Is there a way to detect a double-click in a treeview?
>
>Yes -- connect a signal handler to the button press signal on the treeview.
>
>Then the signal handler should look something like this:
>
>bool MyWindow::on_mytreeview_button_press_event(GdkEventButton *ev)
>{
>   if (ev->type == GDK_2BUTTON_PRESS) {
>      // it's a double click, so do something...
>   }
>
>   return false;
>}

true. just be warned that if you have a handler for a single press
and/or single release, these will be executed before the one that sees
the 2 button press. this can get gnarly, quite rapidly.

--p



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