wx.GridCellAttr for setting editor in entire column

Hi all
I've a trouble with GridCellAttr: I need to make an entire column of a wx.Grid as float with 2 decimals.
While for presenting data it works fine (following hints in the demo), I cannot set lenght and fraction size for entire column.
The only way it works is setting cell by cell, and its not good for large tables.
According with GridCustTable (and here it works) I try to do something like this:

attr = gridlib.GridCellAttr()
attr.SetEditor(gridlib.GridCellFloatEditor(_len, _dec))
self.SetColAttr(col, attr)

But nothing happens, cells on that column still accept everything.
Where am I wrong ?!?

Thanks!
Fabio

jfabio wrote:

Hi all
I've a trouble with GridCellAttr: I need to make an entire column of a wx.Grid as float with 2 decimals.
While for presenting data it works fine (following hints in the demo), I cannot set lenght and fraction size for entire column.
The only way it works is setting cell by cell, and its not good for large tables.
According with GridCustTable (and here it works) I try to do something like this:

attr = gridlib.GridCellAttr()
attr.SetEditor(gridlib.GridCellFloatEditor(_len, _dec))
self.SetColAttr(col, attr)

But nothing happens, cells on that column still accept everything.
Where am I wrong ?!?

Which version? Doing the above works for me.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

attr = gridlib.GridCellAttr()
attr.SetEditor(gridlib.GridCellFloatEditor(_len, _dec))
self.SetColAttr(col, attr)

Which version? Doing the above works for me.

Hi Robin, you're right, i did miss to specify this.
I currently use wx v. 2.5.2.8 with Python v. 2.3.4
This happens on a wx.Grid-derived class, in wich I don't override __init__ method and try to use that piece of code after the grid.SetTable(...) statement.
Hope this helps
Thanks for the attention,
Fabio

Problem solved - I did mismatch CellAttr order calls
Thanks
Fabio