Fix size glitch of WidgetsBookCtrl in widgets sample
The entire control is hidden until the dialog is resized. This seems to be caused by (recent changes in) the wxPersistentManager. This is fixed by populating the frame before restoring persistence. (as is described in docs/doxygen/overviews/persistence.h.)
This commit is contained in:
@@ -381,8 +381,6 @@ bool WidgetsApp::OnInit()
|
||||
WidgetsFrame::WidgetsFrame(const wxString& title)
|
||||
: wxFrame(NULL, wxID_ANY, title)
|
||||
{
|
||||
const bool sizeSet = wxPersistentRegisterAndRestore(this, "Main");
|
||||
|
||||
// set the frame icon
|
||||
SetIcon(wxICON(sample));
|
||||
|
||||
@@ -514,6 +512,8 @@ WidgetsFrame::WidgetsFrame(const wxString& title)
|
||||
|
||||
m_panel->SetSizer(sizerTop);
|
||||
|
||||
const bool sizeSet = wxPersistentRegisterAndRestore(this, "Main");
|
||||
|
||||
const wxSize sizeMin = m_panel->GetBestSize();
|
||||
if ( !sizeSet )
|
||||
SetClientSize(sizeMin);
|
||||
|
Reference in New Issue
Block a user