Changing color of GtkRadioButton
- From: Edoardo Vigoni <vigoni aero polimi it>
- To: gtk-app-devel-list gnome org
- Subject: Changing color of GtkRadioButton
- Date: 16 Jul 2003 09:58:14 +0200
How can I change color of GtkRadioButton when it's pressed? Usually it
has the same color of the window background and it isn't so clear. I can
do it with GtkCheckButton, but I can't with RadioButton. How can I do?
For CheckButton I do in this way:
void set_color_check_button(GtkWidget *Widget)
{
GdkColor Color;
GdkColormap *Cmap;
GtkStyle *Style;
Style = gtk_style_new();
Cmap = gdk_colormap_get_system();
gdk_color_parse("dark red", &Color);
if (!gdk_color_alloc(Cmap, &Color)) {
g_error("couldn't allocate colour");
}
Style -> bg[Widget->state] = Color;
gdk_color_parse("pale green", &Color);
if (!gdk_color_alloc(Cmap, &Color)) {
g_error("couldn't allocate colour");
}
Style -> bg[GTK_STATE_ACTIVE] = Color;
gtk_widget_set_style(Widget, Style);
}
Thanks for your time
Edoardo
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]