Overriding on_motion_notify_event
- From: Thomas Clark <thechewanater gmail com>
- To: gtkmm-list gnome org
- Subject: Overriding on_motion_notify_event
- Date: Mon, 16 Aug 2010 19:36:02 -0400
I'm trying to override the virtual function on_motion_notify_event in a
Gtk::DrawingArea, but the function never seems to be called. I don't get why,
since DrawingArea inherits from Widget. So, when does a motion notify event ever occur?
Here's a minimal example of what I mean:
#include <iostream>
#include <gtkmm.h>
class Area: public Gtk::DrawingArea
{
public:
Area () {}
private:
//never called?
virtual bool on_motion_notify_event (GdkEventMotion *event)
{
std::cout << event->x << '\t' << event->y << '\n';
}
};
int main (int argc, char **argv)
{
Gtk::Main test (argc, argv);
Gtk::Window window (Gtk::WINDOW_TOPLEVEL);
Area area;
window.add (area);
window.show_all ();
test.run (window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]