wx.MessageDialog

You all have been very helpful so far, thank you. I have another
question for you:

OnLoseFocus of particular controls I am calling a function which
displays the wx.MessageDialog.

Occasionally the Dialog will be displayed except with an error causing
strange behavior and possible app freeze.

It fails on this line:

dlg.ShowModal()

File C:\Python23\Lib\site-packages\wx\windows.py", line 449 in
ShowModal return _windows.Dialog_ShowModal (*args, **kwargs)
return _windows.Dialog_ShowModal(*args, **kwargs)
x.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in
..\..\src\msw\msgdlg.cpp
expected ::MessageBox() return code

It's confusing because this doesn't happen every time. Have any ideas
on this?

Thanks a lot,

Keith Bolton
BPC

Keith Bolton wrote:

It fails on this line:

dlg.ShowModal()

File C:\Python23\Lib\site-packages\wx\windows.py", line 449 in
ShowModal return _windows.Dialog_ShowModal (*args, **kwargs)
return _windows.Dialog_ShowModal(*args, **kwargs)
x.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in
..\..\src\msw\msgdlg.cpp
expected ::MessageBox() return code

It's confusing because this doesn't happen every time. Have any ideas
on this?

Something is causing the native MessageBox API function to return an unexpected value. Do you do anything different when dismissing the dialog when the exception is raised? Can you duplicate it in a small sample app?

ยทยทยท

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