Re: [gtkmm] catching doubleclicks



>Hi,
>
>do I need an eventbox (in a normal button) to catch a doubleclick or is the
>a more simple solution to it???
>
>I've tried the following without an eventbox:
>button6->clicked.connect(SigC::slot(static_cast<class
>setuphelpwindow*>(this),  &setuphelpwindow::on_helpaboutbutton_clicked));
>and alternatively also
>button6->button_press_event.connect(SigC::slot(static_cast<class
>setuphelpwindow*>(this), &setuphelpwindow::on_helpaboutbutton_clicked));
>in conjunction with my callback routine:
>void setuphelpwindow::on_helpaboutbutton_clicked(GdkEventButton *ev)
>{   
>  if (ev->type == GDK_2BUTTON_PRESS)
>    cout << "double clicked" << endl;
>}
>but it doesn't compile fine and I don't know what the problem is! (Is this
>approach any useful anyway?)
>Can someone please tell me what I'm doing wrong (and give me hints on what
>to fix)? Thank you!

there are several button-related signals.

      clicked
      button_press
      button_release

the clicked form does not deliver a GdkEvent to the handlers, and
doesn't require them to return a value.

the press and release forms do deliver a GdkEvent, but expect a return
type of gint.

--p



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