left mouse click error

hi

This weird error has been reported by a user of an application I have developed. Under WinXP Home SP2 the app produces this error when the left mouse click in pressed. Other mouse events are fine.

Traceback (most recent call last)
  File "mirra\main.pyo", line 200, in OnRightMouseUp
   File "mirra\events.pyo", line 261, in wxrightMouseUp
   File "wx\_core.pyo", line 9311, in ReleaseMouse
wx._core.PyAssertionError: C++ assertion "GetCapture() == this" failed in ..\..\src\common\wincmn.cpp(2441): attempt to release mouse, but this window hasn't captured it

I tested it under XP Pro SP2 and I dont see any error at all, this why I think is weird. I dont really know what could be the cause of this, maybe something installed on her machine, or a bug in wxPython? I thought it might ring some bells to someone in the list.

thanks

enrike

altern wrote:

hi

This weird error has been reported by a user of an application I have developed. Under WinXP Home SP2 the app produces this error when the left mouse click in pressed. Other mouse events are fine.

Traceback (most recent call last)
File "mirra\main.pyo", line 200, in OnRightMouseUp
  File "mirra\events.pyo", line 261, in wxrightMouseUp
  File "wx\_core.pyo", line 9311, in ReleaseMouse
wx._core.PyAssertionError: C++ assertion "GetCapture() == this" failed in ..\..\src\common\wincmn.cpp(2441): attempt to release mouse, but this window hasn't captured it

I tested it under XP Pro SP2 and I dont see any error at all, this why I think is weird. I dont really know what could be the cause of this, maybe something installed on her machine, or a bug in wxPython? I thought it might ring some bells to someone in the list.

The easiest way to work around this is to check if you still have the mouse capture before releasing it:

  if self.HasCapture():
    self.ReleaseMouse()

The more proper way to take care of it is to catch the EVT_MOUSE_CAPTURE_CHANGED event and do whatever internal housekeeping is needed to change the state of your app so it doesn't think that it still has the mouse captured, so when the button up event happens later it won't try to release it.

BTW, you may be able to duplicate the problem if you can cause a dialog in your app or some other app to be shown while you are doing your captured dragging.

···

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

Robin Dunn(e)k dio:

altern wrote:

hi

This weird error has been reported by a user of an application I have developed. Under WinXP Home SP2 the app produces this error when the left mouse click in pressed. Other mouse events are fine.

Traceback (most recent call last)
File "mirra\main.pyo", line 200, in OnRightMouseUp
  File "mirra\events.pyo", line 261, in wxrightMouseUp
  File "wx\_core.pyo", line 9311, in ReleaseMouse
wx._core.PyAssertionError: C++ assertion "GetCapture() == this" failed in ..\..\src\common\wincmn.cpp(2441): attempt to release mouse, but this window hasn't captured it

I tested it under XP Pro SP2 and I dont see any error at all, this why I think is weird. I dont really know what could be the cause of this, maybe something installed on her machine, or a bug in wxPython? I thought it might ring some bells to someone in the list.

The easiest way to work around this is to check if you still have the mouse capture before releasing it:

    if self.HasCapture():
        self.ReleaseMouse()

The more proper way to take care of it is to catch the EVT_MOUSE_CAPTURE_CHANGED event and do whatever internal housekeeping is needed to change the state of your app so it doesn't think that it still has the mouse captured, so when the button up event happens later it won't try to release it.

BTW, you may be able to duplicate the problem if you can cause a dialog in your app or some other app to be shown while you are doing your captured dragging.

thanks! any ideas why this is just happening on a XP SP2 Home machine? I did not get any other person complaining about this. Maybe they just dont say anything.

altern wrote:

thanks! any ideas why this is just happening on a XP SP2 Home machine? I did not get any other person complaining about this. Maybe they just dont say anything.

It may be that the person who is reporting the problem has other software installed that has popups or other behavior that could also cause your app to lose its capture.

···

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