I don’t undestand why FreezeTo returns False
(and does nothing) in this minimal example. I have read the documentation about the limitations of FreezeTo
in wx.grid.Grid
but I don’t understand which of those limitations I am triggering.
import wx
import wx.grid as grid
class TestFrame(wx.Frame):
def __init__(self):
super().__init__(None, title="Freeze rows/columns")
ROWS = 7
COLS = 7
g = grid.Grid(self)
g.CreateGrid(ROWS, COLS)
# Populate the grid
for row in range(ROWS):
for col in range(COLS):
g.SetCellValue(row, col, f"{chr(ord('A')+col)}-{1+row}")
self.Sizer = wx.BoxSizer()
self.Sizer.Add(g, 1, wx.EXPAND)
frozen = g.FreezeTo(2,1)
print(frozen)
# Next, create an application object.
app = wx.App()
# Then a frame.
frm = TestFrame()
# Show it.
frm.Show()
Thank you.