[wxPython-users] Anyone With Experience With Andrea's FloatSpin? -- SOLVED!

Andrea Gavana andrea.gavana at gmail.com
Wed Jan 3 05:33:53 PST 2007


Hi Rich,

> On Tue, 26 Dec 2006, Rich Shepard wrote:
>
> >  I have one REAL value for which I'm using Andrea's FloatSpin() widget. It
> > works well except when I try to write the value to an embedded pysqlite2
> > database. The error I get is:
>
>   OK. Explicitly casting the 'self.va' to a float in the embedded SQL did
> the trick. Please return to your normal twixt-holiday activities.

Sorry for the late answer. The main problem here is that FloatSpin
does not return a "float": the abiliity of FloatSpin to handle (in
theory) infinite precision number using the FixedPoint class is the
culprit. When you do:

MyFloatSpin.GetValue()

the widget returns an instance of the FixedPoint class, not a floating
point number. Explicitly casting this return value as a float solves
all the problems, although I am thinking about doing that inside the
source code to avoid further problems in future.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/




More information about the wxpython-users mailing list