wx.Window.CaptureMouse

I’m coding a Drag and Drop interaction and it seems that when I capture the mouse with one window on LEFT_DOWN, then the LEFT_UP event will only be caught by that window even if I use evt.Skip() in the handler.

Is this correct? Is there any way of getting the event to propagate the window(s) that normally would have caught the LEFT_UP event.

The reason I am capturing the mouse to begin with is the source of the drag operation needs to know when a release happens.

Thanks
Adam

Adam Fraser wrote:

I'm coding a Drag and Drop interaction and it seems that when I capture the mouse with one window on LEFT_DOWN, then the LEFT_UP event will only be caught by that window even if I use evt.Skip() in the handler.

Is this correct?

Yes. Capturing the mouse means that all mouse events go to the widget that did the capture.

Is there any way of getting the event to propagate the window(s) that normally would have caught the LEFT_UP event.

Not from wx, it would have to be done using native APIs.

The reason I am capturing the mouse to begin with is the source of the drag operation needs to know when a release happens.

Is there some reason that the wx DnD system won't work for you?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

I’m not using wx DnD because the objects I’m dragging contain wx.Bitmaps (a displayed thumbnail image) and image data in numpy arrays… since the wx.Bitmaps couldn’t be pickled, I had to work against the DnD mechanism to move a series of selected objects. Instead I used default_copy, and passed all the object data but the bitmaps and recreated them on the other side of the drop. When that was done, the source would destroy the objects that were selected to complete the move. It was just awkward and required extra computation to be done for large selections of images when all the bitmaps had to be recomputed.

···

On Sun, Oct 19, 2008 at 12:29 AM, Robin Dunn robin@alldunn.com wrote:

Adam Fraser wrote:

I’m coding a Drag and Drop interaction and it seems that when I capture the mouse with one window on LEFT_DOWN, then the LEFT_UP event will only be caught by that window even if I use evt.Skip() in the handler.

Is this correct?

Yes. Capturing the mouse means that all mouse events go to the widget that did the capture.

Is there any way of getting the event to propagate the window(s) that normally would have caught the LEFT_UP event.

Not from wx, it would have to be done using native APIs.

The reason I am capturing the mouse to begin with is the source of the drag operation needs to know when a release happens.

Is there some reason that the wx DnD system won’t work for you?

Robin Dunn

Software Craftsman

http://wxPython.org Java give you jitters? Relax with wxPython!


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users