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



On Sun, 2007-09-02 at 18:04 +0200, Philipp Klaus Krause wrote:
> 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)

C++ strikes again. thats a legal function declaration but it does not
override the virtual method in the parent class. you want

   bool Display::on_scroll_event (GdkEventScroll* ev) { ... }

note the argument type.

--p





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