Button Realease Events



Hi

I'm using a drawing area in my application. The user is supposed to be
able to zoom by drawing a rectangle with the mouse. 

I attach to button_press_event, button_release_event and
motion_notify_event. This works fine exept when: 

The user presses the button, moves the pointer out of the drawing area and
over e.g. a button and releases the mouse-button. Then the release event
is sent to the button, and not to the drawing area. 

To clarify: When pressing the mouse button and move the pointer outside
the widget, the motion_notify and release events are still sent to the
widget even if the button is released elsewhere and even if the pointer
moves outside the window.

But if there is a widget that wants release events under the cursor when
the button is released, the event goes to that widget instead of my
drawing area. 

I see that the button widget and the gimp drawing area have worked this
out, but I can't figure out how. That is, when zooming in gimp and moving
the mouse outside the canvas and over e.g. the destroy-window-button and
release the zoom gets the event.

How is that done?

/Johan




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