问题
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.
来源:https://stackoverflow.com/questions/59585773/how-do-i-stop-artifacts-from-wxwidgets-sizer-being-redrawn