There seem to be a bug in wx.lib.buttons.GenToggleButton. When you try to open a dialog in modal mode in an event caused by a toggle-button, the dialog doesn't receive input properly. See the attached example of the problem, test.py.
How I do to trigger it (using the example program):
Click the toggle me!-button, now I can write in the text control, but not click on "Ok" or "Cancel". Next I get focus to another window (which is not this program) and again focus the test program, now I can click on ok or cancel. Now I can additionally move the dialog window and beneath this I can see another equivalent dialog window. When I press ok or cancel I get this traceback:
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\lib\buttons.py", line 534, in OnLeftUp
self.ReleaseMouse()
File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\_core.py", line 9278, in ReleaseMouse
return _core_.Window_ReleaseMouse(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "GetCapture() == this" failed in ..\..\src\common\wincmn.cpp(2439): attempt to release mouse, but this window hasn't captured it
I have also tested with other types of dialogs with the same result.
There seem to be a bug in wx.lib.buttons.GenToggleButton. When you try to open a dialog in modal mode in an event caused by a toggle-button, the dialog doesn't receive input properly. See the attached example of the problem, test.py.
How I do to trigger it (using the example program):
Click the toggle me!-button, now I can write in the text control, but not click on "Ok" or "Cancel". Next I get focus to another window (which is not this program) and again focus the test program, now I can click on ok or cancel. Now I can additionally move the dialog window and beneath this I can see another equivalent dialog window. When I press ok or cancel I get this traceback:
Traceback (most recent call last):
File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\lib\buttons.py", line 534, in OnLeftUp
self.ReleaseMouse()
File "C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wx\_core.py", line 9278, in ReleaseMouse
return _core_.Window_ReleaseMouse(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "GetCapture() == this" failed in ..\..\src\common\wincmn.cpp(2439): attempt to release mouse, but this window hasn't captured it