[wxPython-users] a question about Gridcellattr
Robin Dunn
robin at alldunn.com
Mon Jul 23 11:22:12 PDT 2007
Lee DYER wrote:
> now I want add a group of checkbox in a column of a wx.grid.Grid,I write
> my code like this:
>
> attr = wx.grid.GridCellAttr()
> attr.SetEditor(wx.grid.GridCellBoolEditor())
> attr.SetRenderer(wx.grid.GridCellBoolRenderer())
> WholeGrid.SetColAttr(2,attr)
>
> the WholeGrid is the object of a Grid,and this code works;but the
> checkbox is at the left side of every cell
> I use attr.SetAlignment(2,2) in order to set the checkbox at the center
> of a cell,but when I run the code,I find the checkbox disappears
>
> How can I do this?
Where do the 2's come from? Try wx.ALIGN_CENTER instead.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list