events from mouse wheel - button press event? scroll event?



I have a
bool Display::on_button_press_event(GdkEventButton *ev)
{
	std::cout << "\nButton pressed";
	std::cout.flush();
	return(true);
}
in my widget. It is called when I press a mouse button (my mouse has 5
buttons, works for all of them).
However I want to get an event when I use the mouse wheel. I've read
somewhere that the mouse wheel is seen as extra mouse buttons by the
application, but on_button_press_event is not called when I use the wheel.

I have a
bool Display::on_scroll_event(GdkEventButton *ev)
{
	std::cout << "\nScrolled";
	std::cout.flush();
	return(true);
}
, too, but it isn't called either.

I have
add_events(Gdk::BUTTON_PRESS_MASK | Gdk::SCROLL_MASK);
in my constructor.

Philipp



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