From: Michal S. <hra...@ce...> - 2009-02-25 23:25:11
|
On 26/02/2009, Michal Suchanek <hra...@ce...> wrote: > Hello > > > On 23/01/2009, Roy Wright <rub...@an...> wrote: > > > > > > > Take a look at: > > > > http://www.kksou.com/php-gtk2/articles/input-or-edit-numbers-in-GtkTreeView-with-GtkCellRendererSpin.php > > > > > Thanks for this sample. > > It shows clearly that the cell renderers have an undocumented property > text which also gets propagated as the value of the > GtkCellRendererSpin adjustment. > > However, there is a bug somewhere that prevents me from incrementing > the spinbutton value in non-integer steps. The value gets rounded > somewhere, and I am not aware of ever doing that. > > In fact I can type an exact value and my handler sets it into the > model (I wish there was a default handler doing just that) but > whenever the value is loaded into the spinbutton it is rounded. It's because the renderer displays the value differently when inactive and while editing. It can be seen by uncommenting the part with set_digits() The value is a plain label normally with many decimal places but the spinbutton only has as many decimal digits as set with the digits property thus the value is rounded when loaded into the spinbutton. The odd things that happen here are two: - the renderer sets digits on the spinbutton but does not heed the property for the label - the spinbutton rounds the value when set but allows entering exact value manually Thanks Michal |