Re: GtkEntry and numeric floating point input
- From: Olexiy Avramchenko <olexiy ctech cn ua>
- To: Neil Zanella <nzanella gmail com>
- Cc: GTK List <gtk-list gnome org>
- Subject: Re: GtkEntry and numeric floating point input
- Date: Fri, 03 Dec 2004 09:38:43 +0200
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]