- // NB: unlike for the "activate" signal, when this callback is called, if
- // we try to query the "collapsed" status through p->IsCollapsed(), we
- // get the right value. I.e. here p->IsCollapsed() will return false if
- // this callback has been called at the end of a collapsed->expanded
- // transition and viceversa. Inside the "activate" signal callback
- // p->IsCollapsed() would return the wrong value!
-
- wxSize sz;
- if ( p->IsExpanded() )
- {
- // NB: we cannot use the p->GetBestSize() or p->GetMinSize() functions
- // here as they would return the size for the collapsed expander
- // even if the collapsed->expanded transition has already been
- // completed; we solve this problem doing:
-
- sz = p->m_szCollapsed;
-
- wxSize panesz = p->GetPane()->GetBestSize();
- sz.x = wxMax(sz.x, panesz.x);
- sz.y += gtk_expander_get_spacing(GTK_EXPANDER(p->m_widget)) + panesz.y;
- }
- else // collapsed