+ if ( scrolled )
+ {
+ // Set the fixed size to ensure that the scrollbars are shown.
+ m_panel->SetSize(300, 300);
+
+ // And also actually enable them.
+ m_panel->SetScrollRate(10, 10);
+ }
+ else
+ {
+ // Use the fitting size for the panel if we don't need scrollbars.
+ topSizer->Fit(m_panel);
+ }
+
+ SetClientSize(m_panel->GetSize());