Cannot see Panel after Splitwindows

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
enricovittorini
Knows some wx things
Knows some wx things
Posts: 34
Joined: Mon Nov 07, 2022 2:54 pm

Cannot see Panel after Splitwindows

Post by enricovittorini »

Hello all,
I have the following Layout:

a Frame (this in the following code).
Then I define a wxBoxsizer and assign it to the Frame: this->SetSizer(mainSizer);

Then I define three panels and put them in the main sizer.

Code: Select all

m_panel_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
m_panel_center = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
m_panel_bottom = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
	
mainSizer->Add(m_panel_top, 1, wxEXPAND);
mainSizer->Add(m_panel_center, 1, wxEXPAND);
mainSizer->Add(m_panel_rbottom, 1, wxEXPAND);
In the top panel I add a sizer (headerSizer) and I add controls in it. This one is shown correctly.

In the center panel I define a splitterSizer and create a splitwindows etc..... This is shown correctly.

In the bottom panel I create a bottomSizer and some controls then set the sizer to the bottom sizer but this one is not displayed:

m_panel_bottom->SetSizer(bottomSizer );

any clue?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Cannot see Panel after Splitwindows

Post by ONEEYEMAN »

Hi,
Did you call Layout() at the end?
You sure you didn't explicitly called Hide()?
Did you try to see what is happening with the debugger?

Thank you.
User avatar
doublemax@work
Super wx Problem Solver
Super wx Problem Solver
Posts: 474
Joined: Wed Jul 29, 2020 6:06 pm
Location: NRW, Germany

Re: Cannot see Panel after Splitwindows

Post by doublemax@work »

enricovittorini wrote: Tue Dec 06, 2022 10:13 am In the center panel I define a splitterSizer and create a splitwindows etc..... This is shown correctly.
Is the splitterwindow essential to reproduce the error? If yes, please show the complete relevant code.

If not, please reduce the sample to the absolute minimum to see the error.
enricovittorini
Knows some wx things
Knows some wx things
Posts: 34
Joined: Mon Nov 07, 2022 2:54 pm

Re: Cannot see Panel after Splitwindows

Post by enricovittorini »

Found the issue. The center panel has a wxBoxSizer instead of wxFlexGridSizer.
Post Reply