GNOME Bugzilla – Bug 162326
BUTTON_PRESS_EVENT not caught
Last modified: 2008-06-08 13:05:21 UTC
An application I am working on has an object derived from Gnome::Canvas::Canvas, and contains some objects derived from Gnome::Canvas::Pixbuf; I set a signal handler in the Pixbuf-derived object, and I can see that it receives all events except Gdk::BUTTON_PRESS_EVENT (i.e. ENTER and LEAVE_NOTIFY, MOUSE_MOTION and even BUTTON_RELEASE). Google searching results in only this other post describing the same problem: http://mail.gnome.org/archives/gtkmm-list/2004-July/msg00083.html Unfortunately, the recommended answer presented in that thread, use 'add_events' to make sure that the event mask is set correctly, doesn't work because Canvas::Item doesn't derive from Gtk::Widget, it derives directly from Gtk::Object. The expected behaviour is that Canvas::Item s also receive the BUTTON_PRESS event; currently my workaround is to move the item signal handler into the canvas itself and special case a button press event that is also over an Item, which is an inelegant solution. Interestingly, the canvas_events.cc example from the libgnomecanvasmm module (i.e. via viewcvs on cvs.gnome.org) (when the sigc::slot functino calls are replaced with sigc::mem_fun so that it actually compiles) does respond to button press events on the items, but with as far as I can tell identical code I can't reproduce that (correct) behaviour. I'm using libgnomecanvasmm-2.6 and related libraries as packaged in Ubuntu Warty. Marking as severity "major" because the behaviour suggests that the implementation is incomplete.
Can you provide a test case for this bug? (In c, if possible, if not, c++ is fine as well)
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for. Thanks!