c - GTK+ 2 change label color of GtkCheckButton -
i change default label color of gtkcheckbutton. surely need access gtkcontainer or gtkbin , iterate through children. however, have not found code this.
i have:
gtkwidget* mycheckbox = gtk_check_button_new_with_label("hello"); gdkcolor color; gdk_color_parse ("#ff0000", &color); gtk_widget_modify_fg (mycheckbox, gtk_state_normal, &color);
but modifies border's color.
any ideas?
ok, code works:
if(gtk_is_bin(mycheckbox)) { gtkwidget *child = gtk_bin_get_child(gtk_bin(mycheckbox)); gdkcolor color; gdk_color_parse ("#ff0000", &color); gtk_widget_modify_fg (child, gtk_state_normal, &color); }
the idea came finding children of gtkwidget.
hth
Comments
Post a Comment