Re: catching a mouse scroll event on a Gtk::DrawingArea



Have you added the necessary events? (i.e. Gtk::Widget::add_events())

Jonner

On 2/18/06, Rob Benton <rob benton conwaycorp net> wrote:
> Can this be done?  I tried with the signal_scroll_event() signal but I'm
> not getting into the handler:
>
>
> MyWindow::MyWindow()
> {
>    _drawarea.signal_scroll_event().connect(sigc::mem_fun(*this,
>      &MyWindow::on_drawarea_scroll));
> }
>
> bool MyWindow::on_drawarea_scroll(GdkEventScroll * e)
> {
>    if (e->direction == GDK_SCROLL_UP)
>    {
>      // up code
>    }
>    else if (e->direction == GDK_SCROLL_DOWN)
>    {
>      // down code
>    }
>    g_print("%d\n", e->direction);
>
>    return true;
> }
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>



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