Connecting to Gtk::SpinButton::signal_scroll_event()?



Can I add an event hander for the "scroll event" on a SpinButton?

I've tried

bool ThisClass::OnScrollEvent(GdkEventScroll *event)
{
 cerr << "ThisClass::onScrollEvent\n";

 return false;
}
...

spinbutton.signal_scroll_event().connect(sigc::mem_fun(*this, &ThisClass::onScrollEvent));

(or rather, the equivalent code in a somewhat more complex class setup...)

This builds all right, but the handler doesn't seem to get called, i.e. the text from "cerr" is never displayed. I also added

spinbutton.set_events(Gdk::ALL_EVENTS_MASK);

to make absolutely sure the event would be received, but it didn't make any difference.

So, is there anything special about a SpinButton that prevents the above from working? I mean, this is based on code that has worked in the past for a simple Entry widget.

In case you wondered, I'm trying to override/add to the default scroll handling in order to allow "spin" by different amounts depending on the modifier state.

--
- Toralf



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