GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GtkEntry -To read a user entered text.

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
rahul.sp
Familiar Face


Joined: 18 Mar 2008
Posts: 7

PostPosted: Tue Mar 18, 2008 10:59 am    Post subject: GtkEntry -To read a user entered text. Reply with quote

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

PostPosted: Tue Mar 18, 2008 1:08 pm    Post subject: Reply with quote

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

PostPosted: Tue Mar 18, 2008 1:20 pm    Post subject: Reply with quote

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

PostPosted: Tue Mar 18, 2008 4:50 pm    Post subject: Reply with quote

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

PostPosted: Wed Mar 19, 2008 4:07 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP