Re: wx.lib.agw.aui.AuiNotebook => Tab drag/drop bug
Eric Fahlgren <[email protected]>
| Newsgroups | gmane.comp.python.wxpython.devel |
|---|---|
| Message-ID | <CAP2Qz+WmfJrS885d0S9mNhZQmLFroYN49RAQeoCshs24zPJuJQ@mail.gmail.com> |
Hmm, I have some code that does mouse capture, and I couldn't get HasCapture to work either (written maybe 10 years ago??? never re-examined it). I just added a "self.captured" state, changing it explicitly when I capture and release, then added an event handler to change the state when I don't get that explicit enter/leave event. I suspect HasCapture is missing something like this? >>> self.Bind(wx.EVT_MOUSE_CAPTURE_LOST, self.OnCaptureLost) On Thu, Nov 24, 2016 at 9:48 AM, Harald Hanöfner <[email protected]> wrote: > If you want drag-and-drop a tab of a wx.lib.agw.aui.AuiNotebook the > application hangs after releasing the left mouse and the following error > message occurs. > (Environment: Python 3.5.2 | wxPython_Phoenix-3.0.3. > dev2680+55dda48-cp35-cp35m-win32.whl | Windows 10) > > Traceback (most recent call last): > File "C:\Program Files (x86)\Python 3.5\lib\site-packages\wx\lib\ > agw\aui\auibook.py", line 2023, in OnLeftUp > self.ReleaseMouse() > wx._core.wxAssertionError: C++ assertion "!wxMouseCapture::stack.empty()" > failed at ..\..\src\common\wincmn.cpp(3319) in wxWindowBase::ReleaseMouse > (): Releasing mouse capture but capture stack empty? > > When I look into the code I see the following there: > > 2022 if self.HasCapture(): > 2023 self.ReleaseMouse() > > Very surprising, because the mouse releasing is checked before the call!? > I have no idea why that exception raised. With python 2.7 and wxPython > 3.0.2.0 this code makes no problems. > > A similar problem I have sometimes when I move the whole application > window. Then I get the following error message. > > Traceback (most recent call last): > File "C:\Program Files (x86)\Python 3.5\lib\site-packages\wx\lib\ > agw\aui\framemanager.py", line 9219, in OnLeftUp > self._frame.ReleaseMouse() > wx._core.wxAssertionError: C++ assertion "!wxMouseCapture::stack.empty()" > failed at ..\..\src\common\wincmn.cpp(3319) in wxWindowBase::ReleaseMouse > (): Releasing mouse capture but capture stack empty? > > But that error only appears very seldom and not predictable. But the > problem is the same as above => with calling the method ReleaseMouse() > despite of a previous HasCapture() check. > > Hope somebody can help me. Thanks! > > -- > You received this message because you are subscribed to the Google Groups > "wxPython-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "wxPython-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.