|
|
| Author |
Message |
|
|
rahul.sp Familiar Face
Joined: 18 Mar 2008 Posts: 7
|
Posted: Tue Mar 18, 2008 10:59 am Post subject: GtkEntry -To read a user entered text. |
|
|
Hi,
How do you read a user entered text in GtkEntry.
Its not working with gtk_entry_get_text.
Thanks. |
|
| Back to top |
|
 |
ichbinsnur
Joined: 16 Mar 2008 Posts: 4
|
Posted: Tue Mar 18, 2008 1:08 pm Post subject: |
|
|
Hi,
seems that this is the forum of "many questions and no answers".
I don't know, what's wrong, i don't know your code.
I tried this and this works fine:
GtkWidget * editfield;
editfield = gtk_entry_new( );
gtk_entry_set_text( (GtkEntry*)editfield, (gchar*)"Test" );
printf("%s\n", gtk_entry_get_text( (GtkEntry*)editfield )); |
|
| Back to top |
|
 |
rahul.sp Familiar Face
Joined: 18 Mar 2008 Posts: 7
|
Posted: Tue Mar 18, 2008 1:20 pm Post subject: |
|
|
Hi,
Thanks for resopnding.
The code you have written is fine and works.
I want the user to edit the text displayed on the gtkentry and my program must now read the text as entered by the user.
Hope u understood my question.
Thanks
Rahul. |
|
| Back to top |
|
 |
ichbinsnur
Joined: 16 Mar 2008 Posts: 4
|
Posted: Tue Mar 18, 2008 4:50 pm Post subject: |
|
|
don't understand the problem, because the function gets the text in the entry field. no matter, who wrote it in (by program or by user).
maybe your problem is, that you have to get the notification, that the user typed in a new text !? |
|
| Back to top |
|
 |
rahul.sp Familiar Face
Joined: 18 Mar 2008 Posts: 7
|
Posted: Wed Mar 19, 2008 4:07 am Post subject: |
|
|
Hi,
Problem solved..
Thanks, I was not reading the entry at the correct time, which is why it always showed me the previous entry.
Thank you for responding.
I have posted another question with respect to GtkTextView,please take a look at that too.. |
|
| Back to top |
|
 |
|