Hi,
I want to implement a wxGrid that can keep the height of the rows when
the rows are being moved. I checked the grid demo GridDragable.py in
the standard demo and find it has a bug.
In the demo, when you increase the height of the first row, then try
to drag this row to the last row, the following exception is raised:
Traceback (most recent call last):
File "GridDragable.py", line 186, in OnRowMove
self.GetTable().MoveRow(frm,to)
File "GridDragable.py", line 150, in MoveRow
grid.ProcessTableMessage(msg)
File "/root/temp/wxPython-src-2.8.1.1/wxPython/wx/grid.py", line
1200, in ProcessTableMessage
return _grid.Grid_ProcessTableMessage(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "uiIndex < m_nCount" failed
at /opt/wx/2.8/include/wx-2.8/wx/dynarray.h(813) in Item()
I'd like to know what exactly the code segment in the demo is trying to do:
# Notify the grid
grid.BeginBatch()
msg = gridlib.GridTableMessage(
self, gridlib.GRIDTABLE_NOTIFY_ROWS_DELETED, frm, 1
)
grid.ProcessTableMessage(msg)
msg = gridlib.GridTableMessage(
self, gridlib.GRIDTABLE_NOTIFY_ROWS_INSERTED, to, 1
)
grid.ProcessTableMessage(msg)
grid.EndBatch()
Especially, what is a GridTableMessage and how does it impact on the
outlook of the grid? Can anyone give an explanation, since information
on this is hard to find.
Thanks!