Re: How to enter a floating-point number ?



Le mer 26/05/2004 à 22:16, Tristan Van Berkom a écrit :
Gan3sh wrote:
Hi,

I would like to add a widget in my application to be able to enter a
floating-point number and only that.
If I use a GtkEntry, I didn't see in the doc how to restrict the
available characters to only digits (and also . + -).
And if I use a GtkSpinButton, I didn't see how to set the arrows
unvisible.

Is there another widget for entering only a number ?

Hmmm,
     I dont think this should be in the gtk+ domain.
Why not just use a GtkEntry and use string conversion utilities
(i.e. isdigit() or some varient) ?


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.

Anyway, thanks to everyone,
Stéphane.




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