catching a mouse scroll event on a Gtk::DrawingArea



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;
}



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