From: Michael H. <mic...@el...> - 2005-09-15 10:34:17
|
Nando, Nando Dessena wrote: > Oops. I missed that subtlety. Anyway, on second read, why using > wxStandardPaths::Get() at all? Let's just use standardPathsM always > and forget about the conditional compilation (except for the call to > SetInstallPrefix()). That was actually the state of affairs until my commit this morning. > It appears to work fine here. Do you want me to > commit it so you can try on Mac OS X, or do you already know it > won't? > > According to a comment from yours I have just read, it won't, but > why? Ok, the whole ugly tale: First we used wxStandardPaths::Get() to query information. The object is of the correct class, but the reference we get back is one to the base class. Thus SetInstallPrefix() can not be called. So I change this to use the private standardPathsM member. Works fine on Linux and MSW, in my tests. But yesterday I saw that it does *not* work on Mac OS X. It behaves as if it was a common Unix system, ignoring the special OS X paths. The "great" thing is that the object returned by wxStandardPaths::Get() is of class wxStandardPathsCF, as it should be. The private member however was of another class (!). It took me quite a lot of time to track this down, and there is no obvious way to create the correct specialized class as the private member object, without importing implementation details. Note that the same header ($(WXWIN)/include/wx/mac/corefoundation/stdpaths.h), when included in different places, maps wxStandardPaths to two different implementation classes. Completely brain-dead. In essence: In one thread on wx-dev list one of the head devs says that to use SetInstallPrefix() one has to create another instance of wxStandardPaths. In another thread on wx-dev list another one of the head devs says that one must not create another instance of wxStandardPaths in programs for Mac OS X. Thanks -- Michael Hieke |