Re: Why gtk_bin_get_child() does not work?



This should work:

GtkWidget *radio

/*
More code here to get or create 'radio' as
a GtkRadioButton widget
*/

gtk_label_set_markup(GTK_LABEL(GTK_BIN(radio)->child), "<b>hello</b>");



- Micah Carrick
 http://www.micahcarrick.com | GTK+ Forums http://www.gtkforums.com

chao yeaj wrote:
Hello ,everyone

    I have a problem  with  "gtk_bin_get_child"

     my code is like this:
/********************************************************************/
GtkWidget * radio_button = NULL;
GtkWidget * label = NULL;

radio_button = gtk_radio_button_new(NULL);
/*   There ,the pointer  radio_button is not NULL*/

label =  gtk_bin_get_child(GTK_BIN(GTK_BUTTON(radio_button)));
/*     But ,there ,the pointer  label is still  NULL, Why ???  */*/

/********************************************************************************************/

I just want get the label of the radio button,
and then ,use gtk_label_set_markup()  to change the text's font and color

I need you help
Any comments would be much appreciated ,thanks in advance!
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]