I'm having exactly the same problem (sorry to hijack this post, but it appears we're having the same problem at the same time).
When I save a perspective I get this long string (1295 chars). I save it to a config file where I see all 1295 chars. I close the app. When I restart it, I check for the config and try to find the perspective string. If it's there (yes, with an if.. - so I don't load an empty perspective string) I load it. All I see is one toolbar. The other 5 panes that are supposed to be managed by wxAuiManager don't appear.
Strangely enough, if I save/load perspectives within one session (without closing/restarting my app) everything works fine. I can drag panes around then load a perspective and they jump right back to their saved positions.
I've also tried writing and reading the perspective string using the clipboard. From within one session, I save the perspective to the clipboard and paste it into a text editor. I select the text in the editor and copy it. I drag some panes around, then load the perspective from the clipboard - everything works properly. Now I exit the app and restart. When I try to load the perspective from the clipboard (which is still on the clipboard unchanged - verified by pasting it into a text editor again) all of my panes disapear, just like when I read and load it from file.
I verified that the string still contains 1295 chars after it's been loaded the second time.
Here's my code:
Code: Select all
wxFileConfig *ConfigurationFile = new wxFileConfig(_T(""), _T(""),
wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPathWithSep() + "config.ini", _T(""),
wxCONFIG_USE_RELATIVE_PATH);
// Write GUI configuration from to file
ConfigurationFile->Write(_T("/GUI/LayoutString"), Manager.SavePerspective());
and to load the saved perspective:
Code: Select all
wxFileConfig *ConfigurationFile = new wxFileConfig(_T(""), _T(""),
wxFileName(wxStandardPaths::Get().GetExecutablePath()).GetPathWithSep() + "config.ini", _T(""),
wxCONFIG_USE_RELATIVE_PATH);
// Read GUI configuration from file
wxString LayoutString;
if (ConfigurationFile->Read(_T("/GUI/LayoutString"), &LayoutString))
Manager.LoadPerspective(LayoutString);
In case it's useful, I've attached screenshots of the perspective as-saved, and as-loaded.
Let me know if I should start my own post...
I'm using MSW, wxWidgets 2.8.10.
Thanks!
-Kerry