Problem setting color



Hello,

I whant to set color on a toggle button when it is
pressed. The color depend on several other state
in the program, so I want to be able to set it different
from time to time

I have tried to do

GtkRcStyle *toggle_style;
GdkColor    toggle_color;

...


toggle_color.red = 0xFFFF;
toggle_color.green = 0xFFFF;
toggle_color.blue = 0x0000;

toggle_style = gtk_rc_style_new();
toggle_style->fg[GTK_STATE_NORMAL] = toggle_color;
toggle_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_FG;
gtk_widget_modify_style( theWidget, toggle_style );

gtk_rc_style_unref(toggle_style);

...


but this does not have any effect. What is wrong?

GH

P.S.
I found the exampel on http://www106.pair.com/rhp/gtk-colors.html

----------------------------------------------------------------
Göran Hasse            email: gh raditex se     Tel: 08-6949270
Raditex AB             http://www.raditex.se
Sickla Alle 7, 1tr                              Mob: 070-5530148
131 34  NACKA, SWEDEN





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