On Tue, Feb 25, 2014 at 7:04 AM, Nouvelle Collection <
[email protected]> wrote:
>
>> Try self.Canvas.CaptureMouse()
>
>
> It works, indeed ! (see attachment)
>
>
good to know.
> (I also get Traceback like this :, but maybe this is not very important?,
> it works anyway...
>
> Traceback (most recent call last):
> File "C:\Users\Silk\Desktop\MultiHitDemo(1).py", line 76, in OnUp
> self.Canvas.ReleaseMouse()
> File "C:\ProgramData\Anaconda\lib\site-packages\wx-3.0-msw\wx\_core.py",
> line 10649, in ReleaseMouse
> return _core_.Window_ReleaseMouse(*args, **kwargs)
> wx._core.PyAssertionError: C++ assertion "!wxMouseCapture::stack.empty()"
> failed at ..\..\src\common\wincmn.cpp(3319) in
> wxWindowBase::ReleaseMouse(): Releasing mouse capture but capture stack
> empty?
> )
>
well, it works because wxPython drops exceptions in event handlers. But the
"right" thing to do is to check if the Window has the mouse Captured first:
if self.Canvas.HasCapture():
self.Canvas.ReleaseMouse()
kind of klunky. it might be worth writing a little method:
ReleaseIfCaptured()
or something....
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
[email protected]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mailman.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas