wxCollapsiblePane inside wxSplitterWindow issue Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
thoray
Knows some wx things
Knows some wx things
Posts: 48
Joined: Sun Oct 18, 2015 9:31 am

wxCollapsiblePane inside wxSplitterWindow issue

Post by thoray »

When I put wxCollapsiblePane inside wxSplitterWindow and collapse/expand it, moving of other elements inside the window's boxsizer only happens after I move the sash. As such, expanding doesn't show the contents until I move the sash and collapsing doesn't make other elements reclaim the newly available space until I move the sash. I found very hacky way to force the update as so:

Code: Select all

EVT_COLLAPSIBLEPANE_CHANGED(PANE_COLLAPSE, MyFrame::OnCollapse)

[..]

MyFrame::OnCollapse(wxCollapsiblePaneEvent& event)
{
m_topdownsplitter->SetSashPosition(m_topdownsplitter->GetSashPosition()-1);
m_topdownsplitter->SetSashPosition(m_topdownsplitter->GetSashPosition()+1);
}
But I'm wondering if this could be avoided? This is with GTK2 platform.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxCollapsiblePane inside wxSplitterWindow issue

Post by ONEEYEMAN »

Hi,
You should call Layout() after you change, move or hide GUI element(s).

Thank you.
thoray
Knows some wx things
Knows some wx things
Posts: 48
Joined: Sun Oct 18, 2015 9:31 am

Re: wxCollapsiblePane inside wxSplitterWindow issue

Post by thoray »

Calling Layout() for the parent window made it work, thanks.
Post Reply