GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 02, 2014 4:46 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Button clicked save text
PostPosted: Mon Apr 09, 2007 12:00 pm 
Offline
Familiar Face

Joined: Wed Mar 21, 2007 1:02 pm
Posts: 16
Hi,

I am trying to save the text from a button when it is clicked.

I attach the event like this..

g_signal_connect(G_OBJECT(button),"clicked",G_CALLBACK (FlagClicked), window);

void FlagClicked(GtkWidget *widget, gpointer data)
{
SaveToPreferences("Setup","Language",gtk_button_get_label(GTK_BUTTON(widget)));
}

To check the text I added the line..
g_printf("Button text %s\r\n",gtk_button_get_label(GTK_BUTTON(widget)));

This prints "Button text (null)"

I would appreciate some pointers on where Iam going wrong ? Why can't I access the button text.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 12:20 pm 
Offline
Familiar Face

Joined: Tue Feb 13, 2007 3:45 pm
Posts: 30
Location: Madrid, Spain
Did you set button's label with gtk_button_set_label () ?


Top
 Profile  
 
 Post subject: Human Error..
PostPosted: Mon Apr 09, 2007 12:33 pm 
Offline
Familiar Face

Joined: Wed Mar 21, 2007 1:02 pm
Posts: 16
Thanks that prompted me.

I had a routine that put a label and image inside the button. Looking at the button label was a waste of time.

Regards
/TBlue


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group