0

I have a setup like this:

Frame->Panel->BoxSizer
The BoxSizer has 2 BoxSizers that are hidden at launch:
EditBoxSizer->FlexSizer with some inputs.
GridBoxSizer->Grid

GridBoxSizer has a grid.

EditBoxSizer is simply a few static texts and input boxes.

GridBoxSizer and EditBoxSizer are never shown at the same time. So each always gets 100% of the sizer space.

When EditBoxSizer is displayed, GridBoxSizer is hidden. It works perfect.

When EditBoxSizer is hidden, GridSizer is shown. However I can see the StaticText and Input box artifacts from EditBoxSizer over the grid.

If I minimize and restore the window, it looks perfect.

I feel like I've tried everything:

Hiding all the various sizers and panels then running layout() then showing them. Showing the panel and sizer then running layout() Not hiding the panel.

What is the proper method of redrawing a BoxSizer that is completely being redrawn?

I'm using wxgo, but you can answer in WxWidgets or WxPython and I can translate.

Chemdream
  • 618
  • 2
  • 9
  • 25
  • can you show some code? It should be enough to hide one control, show another control and then call layout() on the outmost sizer. Also, it would be helpful to know platform and wx version. – Igor Jan 03 '20 at 22:09
  • Does wxgo incluse wxSimplebook? If so, wxSimplebook should handle switching between EditBoxSizer and GridBoxSizer for you. You'll need to them both in a panel or some other container window before adding them to the simplebook since the sizers are not windows themselves. – New Pagodi Jan 03 '20 at 22:51
  • It's Windows 10 64bit. I'm uncertain of wx version. It's whatever wxgo uses? https://github.com/dontpanic92/wxGo ... I'll look into SimpleBook. I'd include code, but it's 1000s of lines. Once I get this part working is when I was going to go back and clean it up. hah. – Chemdream Jan 04 '20 at 17:37
  • All sizer elements are supposed to be hidden when the sizer itself is hidden, so if they remain visible in any way, sort or form, it looks like a bug in wxWidgets. But it's really hard to be sure without having a simple way to reproduce it. Updating to the latest (3.1.3 as of this writing) version of wxWidgets can never hurt in case it really is a bug however. – VZ. Jan 05 '20 at 23:05
  • @VZ and Igor thanks for the help! I'm taking your advice on simplebook but I'm having trouble with that and you are helping me there too. hah. https://stackoverflow.com/questions/59723728/wxwidgets-panels-in-sizers-dont-seem-to-be-working – Chemdream Jan 14 '20 at 19:38
  • Switching to simplebook worked perfect. thank you! – Chemdream Jan 16 '20 at 17:59

0 Answers0