Reset wxRibbonPage

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
tulu
In need of some credit
In need of some credit
Posts: 5
Joined: Tue Jan 31, 2017 5:56 pm

Reset wxRibbonPage

Post by tulu »

This is likely a trivial question - so I apologize in advance, but I cannot get this to work.
I have a Frame with ribbon with the following structure:
wxBoxSizer ribSizer
--wxRibbonBar ribBar1
----wxRibbonPage ribPage1
------wxRibbonPanel panel1
------wxRibbonPanel panel2
----wxRibbonPage ribPage2
...
panel1 has to be displayed only under specific circumstances
So, before showing the frame, I call the method:
panel1->Show(<condition>);
That works fine. However, I am not able to shift everything to the left when this panel is hidden.
I tried unsuccessfully:
ribPage1->Realize();
ribBar1->Realize();
ribSizer->Layout();

What I am missing?
And if you have an answer for this, I also need to hide a button inside wxsRibbonButtonBar inside panel2. Would the same solution work for it or are there different steps?
Post Reply