I have a wx.Frame with a wx.GridSizer. This grid contains several custom wx.Panel. I need to swap the content of two cells of my grid. I tried several solutions using Detach, GetItem, and Insert methods without success.
For example suppose I have a 3x3 grid with 8 elements (my custom panels) from 0 to 7. In this case the last cell of the grid is empty. I want to move the last item (grid[7]) in the last cell (grid[8]).
How can I do? And what are the differences if the last the last cell is not empty?
'panelInGrid7' in the following is the instance of your panel which is in grid[7], in gridBagSizer positions this would be in (2, 1)
sizer.Detach(panelInGrid7)
sizer.Add(panelInGrid7, (2,3))
If (2, 3) is not empty you would need to detach that item too and then add it to where you want it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With