Re: GtkEntry and numeric floating point input

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

 



Neil Zanella wrote:

Hello,

I've got a GtkEntry and I need to confine user input into this widget
to numeric values
which will fit into the underlying C data types. What is the best way
to do this? If the
values were only allowed to be integers I'd use a GtkSpinBox (I think
that's what it's
called), but since they are now allowed to have decimal points etc...
what should I
do to be sure the user doesn't enter invalid data. What's the best way?


Hi,

The best way is to use GtkSpinButton widget that works well with both fixed and floating point numbers.

Take a look at:
[GTK+-2.0 tutorial]
http://www.gtk.org/tutorial/sec-spinbuttons.html
[GTK+-2.0 API Reference]
http://developer.gnome.org/doc/API/2.0/gtk/GtkSpinButton.html
http://developer.gnome.org/doc/API/2.0/gtk/GtkSpinButton.html#gtk-spin-button-get-value
http://developer.gnome.org/doc/API/2.0/gtk/GtkSpinButton.html#gtk-spin-button-get-value-as-int


   Olexiy

_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux