Re: Button_ release/pressed_event in DrawingArea


I solved it by adding Gd::BUTTON_PRESS_MASK to set_events function.


Kees Kling wrote:

I'm dispkaying an image in a Gtk::DrawingArea and I try to catch some mouse events

so I did:


Gtk::DrawingArea  drawingRegion = manage ( new Gtk::drawingArea());
drawinRegion->set_events(drawingRegion->get_events() |
Gdk::POINTER_MOTION_MASK | Gdk::SCROLL_MASK | Gdk::BUTTON_RELEASE_MASK ); drawingRegion->signal_expose_event().connect(sigc::mem_fun(*this,&imageModule::on_expose_event)); drawingRegion->signal_scroll_event().connect(sigc::mem_fun(*this,&imageModule::on_scroll_event)); drawingRegion->signal_button_release_event().connect(sigc::mem_fun(*this, &imageModule::on_button_release_event));

My signal handler is;

bool imageModule::on_button_release_event (GdkEventButton* event) {
   cout<<"releasing in imagemodule"<<endl;
   return false;

but this is never called.
You can also see that I also connect expose_event and scroll_event and both work.
What am I doing wrong

Kees Kling
gtkmm-list mailing list
gtkmm-list gnome org

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