Re: How to enter a floating-point number ?



Gan3sh wrote:
Le ven 28/05/2004 à 12:38, Paul Pogonyshev a écrit :

Gan3sh wrote:

The main reason is because some users consider that being able to enter
a letter in "number field" is a bug.
Secondly, there is some overcost in terms of development to display a
message in case of wrong entry.
That's why I was looking a widget that was doing this filter directly.

Maybe you should try GtkSpinButton.

Finally, that's what I use, even if the arrows are not relevant in my
case.

This is a parser problem. Every time a key is pressed, the callback
advances thru your implementation of a floating-point number parser.
When an invalid character is pressed, your callback can simply refuse
to accept the character, make a beep, and display an error message in
the status line. The parser is not hard (only 100 lines of code as
a switch-statement state machine).




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]