Fix a build break on non-Windows platforms caused by upgrading to wxWidgets 3.X.
This is not surprising, since the code had been relying on an internal
API that happened to be exposed by the DSO on Fedora. This revision updates
the code to use public API and it handles more cases (although it's still
not perfect).