default font color for FontDialog on Mac is required

I was getting the assertion below when displaying the FontDialog on Mac OS X and it appears this is due to Mac OS X needing the color set for the font data passed to the dialog.

   File "//Library/Python/2.3/wx/_windows.py", line 2727, in __init__
     newobj = _windows_.new_FontDialog(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in /tmp/BUILD/wxPythonSrc-2.5.2.2p.20040717/src/common/choiccmn.cpp(54): invalid string in wxChoice::SetStringSelection

On Windows this doesn't cause a problem, so perhaps the default constructor for for wx.FontData() uses wx.BLACK by default or the system font dialog defaults to black, but this is the kind of default that might burn people when moving code between platforms.

The fontDialog function in wx.lib.dialogs already sets color and font for the font data.

ka

Kevin Altis wrote:

I was getting the assertion below when displaying the FontDialog on Mac OS X and it appears this is due to Mac OS X needing the color set for the font data passed to the dialog.

  File "//Library/Python/2.3/wx/_windows.py", line 2727, in __init__
    newobj = _windows_.new_FontDialog(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "wxAssertFailure" failed in /tmp/BUILD/wxPythonSrc-2.5.2.2p.20040717/src/common/choiccmn.cpp(54): invalid string in wxChoice::SetStringSelection

Fixed.

···

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