how to read from gtk_entry
- From: edward hage <edha xs4all nl>
- To: gtk-list gnome org
- Subject: how to read from gtk_entry
- Date: Tue, 01 Apr 2003 22:00:17 +0200
Hello,
I created som gtk_entry-fields. I want to read the contents so I can do
someting with the info. But I can't get it right!
I did something like this:
GtkWidget *entry;
char *string;
entry = gtk_entry_new();
gtk_entry_set_text (GTK_ENTRY (entry), " 23.22");
string = gtk_editable_get_char (entry);
But this does not work, I don't read anyting. First question: What goes
wrong?
Second question, is there an event (like a key-event pressed) when the
contents is changed by the user or must I use an alternative way of
checking the contents (with a timer like :
gtk_timeout_add( 1000, Function, NULL); ?)
Third question, I don't have much experience in C, more Matlab. There
you have the function 'str2num' which converts a string, for example
"123.23" into a number or better float in C= 123.23. Is this simpel to
do in the gtk-toolkit or standard C. This is because the contents of the
entry should be a float, so I want to be able to check this to prevent
errors.
Thank you in advance,
Edward
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]