Re: Numeric entry field.



Hi All,
   I am writing an application which has lot of number fields, including
floating and non-floating numbers. Is there any readymade widget which
can be used to enter only floating and other numeric formats.

Thanks and Regards
Deekshit M
-------------------------------------------------
Still single? Click here to find the perfect match.

http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?141
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



Hello, I did same questions in channel #Gtk in irc.gnome.org, but they
told me there's not a specific widget to get numeric data, they did
suggest me GtkSpinbutton, but it's not I need, then I use a GtkEntry to
get numeric data, in callback I use 'atoi' function to covert string into
integer.


#include <stdlib.h>

void callback(GtkWidget *entry)
{
    gint num;
    gchar *str;
    stpcpy(str,gtk_entry_get_text(GtkEntry(entry)));
    num = atoi(str);
    printf("Numeric data is: %d", num);
}




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