wxCollapsiblePane inside wxSplitterWindow issue  [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.
thoray
Earned a small fee
Earned a small fee
Posts: 19
Joined: Sun Oct 18, 2015 9:31 am

wxCollapsiblePane inside wxSplitterWindow issue

Postby thoray » Mon Jun 18, 2018 5:50 pm

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: 2785
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxCollapsiblePane inside wxSplitterWindow issue  [SOLVED]

Postby ONEEYEMAN » Mon Jun 18, 2018 5:52 pm

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

Thank you.

thoray
Earned a small fee
Earned a small fee
Posts: 19
Joined: Sun Oct 18, 2015 9:31 am

Re: wxCollapsiblePane inside wxSplitterWindow issue

Postby thoray » Mon Jun 18, 2018 6:39 pm

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


Return to “C++ Development”

Who is online

Users browsing this forum: Bing [Bot] and 25 guests