GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sat Nov 01, 2014 6:16 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: GtkEntry -To read a user entered text.
PostPosted: Tue Mar 18, 2008 10:59 am 
Offline
Familiar Face

Joined: Tue Mar 18, 2008 10:26 am
Posts: 7
Hi,
How do you read a user entered text in GtkEntry.
Its not working with gtk_entry_get_text.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2008 1:08 pm 
Offline

Joined: Sun Mar 16, 2008 4:25 pm
Posts: 4
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 ));


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2008 1:20 pm 
Offline
Familiar Face

Joined: Tue Mar 18, 2008 10:26 am
Posts: 7
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 18, 2008 4:50 pm 
Offline

Joined: Sun Mar 16, 2008 4:25 pm
Posts: 4
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 !?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 19, 2008 4:07 am 
Offline
Familiar Face

Joined: Tue Mar 18, 2008 10:26 am
Posts: 7
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..


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group