wxListCtrl with CheckBox?
Josiah Carlson
jcarlson at uci.edu
Tue Apr 20 21:34:38 EDT 2004
>>Use wx.Grid, it can place checkboxes in cells.
>
> I can't get that to work either, and I certainly can't get the grid
> cells to line up with the listctrl rows anyway.
>
> This is really holding up my program now, to move on any further I
> really need some way of having a checkbox at the end of every row of a
> few listctrl's.
>
> I can't believe this hasn't already been written - someone must have
> needed to have a "delete row" checkbox or button in a report
> before.....
>
> The only thing I can think of now is some sort of dynamic GridSizer
> that works out the position of every row, but that's really nasty.
What I meant was that you should replace your listctrl with a wx.Grid
instance. You can emulate every bit of functionality (except perhaps
the row-selection) of a listctrl with a Grid. You just need to rewrite
the subclass properly.
In terms of being /able/ to have checkboxes in the Grid, check out the
wxPython demo, it has an example with a checkbox in a cell.
- Josiah
More information about the Python-list
mailing list