A philosophical question about multi-platforming

Chris Mellon arkanes at gmail.com
Mon Mar 12 09:49:31 PDT 2007


On 3/12/07, Hugo Jackson <hugojackson at speedfactory.net> wrote:
> I've been using wxWidgets for a couple of years now. My hat off to
> the implementors and everyone else who helps make it such a great
> development environment.
> My personal development approach is to first implement the
> application in wxGTK and after that's done move on to porting it to
> wxMAC and wxMSW.
> I've just finished a frustrating three days of tracking down a bug in
> the wxMSW implementation of my current application which worked fine
> in wxGTK and wxMAC.
> I have a wxFrame containing a sizer and within that sizer a wxPanel
> that I was periodically transferring a new wxImage to with a wxTimer
> method and OnPaint event method.
> The problem turned out to be that the onPaint logic I had created for
> wxGTK didn't work in wxMSW, in fact it disabled wxTimer interrupts so
> that no timer events were being generated at all.
> The solution was to insert an event.Skip() at the end of my onPaint
> logic.
> For the most part there are not a lot of these problems when porting,
> but because when bugs do occur, they are often buried under lots of
> "working fine" code, making these kinds of bugs often incredibly
> difficult to find.
> So my question is this... how important is it to the implementation
> team to have the different flavors of wxWidgets behave identically?
> Are these differences in behaviour important to implementors or
> should I simply adopt a more cautious approach to development, by
> testing my application more frequently and earlier on?
> As I say, I'm not being critical of the way things are, I just want
> to be more in line with the wxWidgets multi-platform philosophy.
>

The aim of wx is for correct code to work identically on all
platforms. Making incorrect code fail on all platforms, and especially
for it to fail in the same way on all platforms is much harder (the
first is hard enough).

The problem then is identifying the difference between correct and
incorrect, but working, code. I've been thinking there might be a
place for some sort of wx best practices document - much of the
information you'd need is spread around in multiple places or is only
gained by experience.




More information about the wx-users mailing list