I made a class whic extends PyGridCellRenderer and I can set size of columns with self.colSize = SOME_SIZE, but that sets same size for all columns, how can I set size for specific column?
Asked
Active
Viewed 2,183 times
2
-
Have you tried `grid.SetColSize(index, size)`? – alecxe Jul 17 '13 at 12:49
-
I tried, it cant recognize variable grid, undefined variable. – Aleksa Jul 17 '13 at 13:03
-
I mean, you can try to set column sizes by calling `SetColSize` method of the wxgrid itself. – alecxe Jul 17 '13 at 13:06
-
Yes, I can do that, but I need to do it from PyGridCellRenderer. – Aleksa Jul 17 '13 at 19:33
1 Answers
2
Try this:
SetCellSize(row, col, num_rows, num_cols);
Thissets the cell at the coordinates row, col to flow over num_rows rows and num_col columns.
If this is not what you want and want to work with pixel then:
SetColSize(col, width);
SetRowSize(row, height);
you can determine the current size of a row or column using :
GetColSize(col)
GetRowSize(row)
Let me know if it does not work.

Jack_of_All_Trades
- 10,942
- 18
- 58
- 88
-
It works in Grid class, but I wanted to do it in PyGridCellRenderer class which is passed as plugin parameter to Grid class, so I can have only one Grid class and change only plugins that are passed to Grid constructor...But it seems I cant acces grid from PyGridCellRenderer... – Aleksa Jul 17 '13 at 19:29