Setting widget color continuously problem.



This is what I am using to set widget color (Havoc's)
//-----------------------------------------------
 GdkColor red = { 0, 65535, 0, 0 };
 GtkRcStyle *rc_style = gtk_rc_style_new ();
 rc_style->bg[GTK_STATE_NORMAL] = red;
 rc_style->color_flags[GTK_STATE_NORMAL] |= GTK_RC_BG;
 gtk_widget_modify_style (widget, rc_style);
 gtk_rc_style_unref (rc_style);
//---------------------------------------------------

I have a procedure that is continuously called with a
timeout.  The procedure checks system status and sets 
the color of a widget (Frame or Button in this case) 
accordingly red/green.  If this procedure set the
color using above way each time it is called, other 
unrelated widgets get colored as well.  The unrelated
widgets are buttons, some frames, and some text
windows.  If the color is set only once upon a system 
change, then it works fine.  

I want to know the reason for why it does not work in 
the first case. (I have GTK+ v1.2, RH 7.2)

-Victor


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



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