Cross-platform support observations

Justin Binns binns at mcs.anl.gov
Fri Jul 30 14:54:33 CDT 2004


I'm going to try to detail the key points that I've run into when doing
the Mac port.  All of these are GUI/wx related.  If I think of any
others later, of course, I'll send them on ;-)

1) The 'LayoutWindow' pattern, particularly wxSashLayoutWindow and
related classes, simply don't work on the Mac.  Personally, I don't
trust any complex layout mechanisms to even approximate the same result
on different platforms.  As such, I've ported most of the GUIs to use
straight wxBoxSizers (with a very occasional GridSizer).  In the future,
we should avoid using wxSashLayoutWindow objects, and instead use
wxSashWindow objects and manage the sashing more directly, using sizers.

2) wxStaticBox and wxStaticBoxSizer don't do the right thing on the
Mac.  I believe this is a temporary thing, in that it's a bug that will
probably be fixed in the wxWidget world eventually, but for now, these
simply don't look right.  Usually, the problem is manifested as a large
gap of empty space on the top of the box.  I've removed most of the
wxStaticBox objects, and will be removing more in the next couple days. 
I'm replacing them with wxStaticText titles and wxStaticLine objects for
division of sections within a window/panel.

3) wxDEFAULT in the context of a wxFont object is wrong on the Mac. 
This is definitely a bug, hopefully one that will be fixed, but
apparently the 'default' font size in wxMac (as defined by wxDEFAULT) is
HUGE.  This leads to the sprinkling throughout the code of 'if IsOSX()'
calls that make wxFont changes explicitly setting the font size to 12. 
This is just annoying and wrong, but I don't know that there's any other
solution prior to wxWidgets being 'fixed'.

4) wxCheckListBox isn't supported on wxMac or wxCocoa.  This is
documented (in that it is explicitly *only* supported on wxGTK and
wxWindows).  The one place this widget is used is in the
AuthorizationUI, which I changed so that on OS X a simple wxListBox with
multiple selection enabled is used.

Those are the issues so far.

Justin





More information about the ag-dev mailing list