Hi.

I'm looking for a better solution to entering numerical values than that
provided by the gtk.SpinButton gives. The SpinButton is fine for integer
values, but with floating point values I've found it has problems. I'm
trying to ensure that only valid values are entered in the SpinBox, so I
thought calling the set_numeric() method would be useful, but that
method ends up rejecting decimal points when they are typed, so the
SpinBox validation function is useless for my purposes. 

I'm now looking at trying to use the gtk.Entry widget.  Ideally there would
be a way call gtk.Entry() with some type of function to validate that the
entered text can be converted into a floating point value. I'd like to do
this somewhat interactively - checking every character entered by the user,
then testing the so-far completed text to see if a float can be created, and
if not reject the character the user just typed. There doesn't seem to be an
existing method for doing this with the entry box widget; I guess people roll
their own validation routines by connecting to key_press signals in some
fashion. I'm mailing this out in hopes that someone can say "No, Art,
you are wrong. The gtk.Entry() validation technique is ..." and fill in
the "..." parts.

If there are more tricks with the gtk.SpinBox() that I'm missing, I'd
welcome some info on that too.

Thanks in advance.

Art Haas
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to