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);
}
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to