- else // collapsed
- {
- // same problem described above: using p->Get[Best|Min]Size() here we
- // would get the size of the control when it is expanded even if the
- // expanded->collapsed transition should be complete now...
- // So, we use the size cached at control-creation time...
- sz = p->m_szCollapsed;
- }
-
- // VERY IMPORTANT:
- // just calling
- // p->OnStateChange(sz);
- // here would work work BUT:
- // 1) in the expanded->collapsed transition it provokes a lot of flickering
- // 2) in the collapsed->expanded transition using the "Change status" wxButton
- // in samples/collpane application some strange warnings would be generated
- // by the "clearlooks" theme, if that's your theme.
- //
- // So we prefer to use some GTK+ native optimized calls, which prevent too many resize
- // calculations to happen. Note that the following code has been very carefully designed
- // and tested - be VERY careful when changing it!
-
- // 1) need to update our size hints
- // NB: this function call won't actually do any long operation
- // (redraw/relayouting/resizing) so that it's flicker-free
- p->SetMinSize(sz);