Hi, I am struggling to get a custom widget containing a wx.Grid to resize correctly when used in a GridBagLayout.
I want column 0 of the grid to expand, and column 1 to stay the same size so I’m connecting to the EVT_SIZE on the custom widget and changing the column sizes. This works fine and when the frame is made larger the column grows as required.
However strangely, when the frame is shrunk the custom widget size allocation does not change and the second column just disappears off the window!
I’ve attached a much simplified version of the code which shows the problem. If I change the GridBagSizer to a vertical BoxSizer it works (but I can’t do that in the actual code).
broken.py (1.8 KB)
Any ideas? I had to confess I find layout in wx incredibly confusing and there seem to be no end of questions about how to do quite simple things like this. Interestingly it works if I replace my custom panel with a standard control, e.g. a wx.TextCtrl, so evidently it is possible.
Thanks for any help,
Martin