re: SPAM LOW Re: Top Window Background




Yeah, when I use the  gtk_widget_modify_bg(GTK_WIDGET(window), GTK_STATE_NORMAL, &color), the background 
color does not 
 change, even if I use it with all GTK_STATE_...s.

 Andy

----------------------------------------
From: Andreas Stricker <andreas stricker fela ch>
Sent: Wednesday, December 14, 2005 3:01 AM
To: gtk-app-devel-list gnome org
Subject: SPAM LOW Re: Top Window Background 

Andy Grebe wrote:
I've got a callback function where I want to change the background of
the entire window. I can set the color on startup using:

style = gtk_widget_get_style(topWindow);
style->bg[0] = c;
style->bg[1] = c;
style->bg[2] = c;
style->bg[3] = c;
style->bg[4] = c;
gtk_widget_set_style(topWindow, style);

but when I attempt to change the color of the background in a callback
function, it doesn't work. I've also tried the modify_bg function with
the same results.


The right approch is indeed gtk_widget_modify_bg():
GdkColor color;
gdk_color_parse("red", &color);
gtk_widget_modify_bg(GTK_WIDGET(window), GTK_STATE_NORMAL, &color);

Note that the widget must be in the right state.

Cheers,

Andy
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





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