Re: Changing the progress bar color



I've tried this and this works but not when there's an engine theme of
somesort.  In that case it's just a pixmap is there anyway to override the
engine. I tried this
        gtk_rc_parse_string("style \"none\" {}");
        gtk_rc_parse_string("class \"GtkProgressBar\" style \"none\"");
but that doesn't seem to work.

On 22 Jan 2001, Owen Taylor wrote:

> 
> 
> Havoc Pennington <hp redhat com> writes:
> 
> > Jerry Mulchin <jmulchin astroguy com> writes:
> > > I'm trying to change the progress bar's color from the default dark gray
> > > to various colors, depending on what's going on behind the scenes. Is
> > > there an easy way to do this, like a gtk function call to just set it?
> > > 
> > 
> > Set it as you would for any widget, only you are changing the "active"
> > color instead of the "foreground" color I think.
> > 
> > (The way you'd do it for any widget is to create a GtkRcStyle, set the
> > bits for the states/colors to change, call gtk_widget_modify_style(),
> > and unref the rc style.)
> 
> The colors used are actually the bg[PRELIGHT] for the trough and
> the bg[NORMAL] for the background.
> 
> The reason why Havoc is thinking that it might be the active color is
> that the Red Hat GTK+ package includes the fragment in /etc/gtk/gtkrc.
> 
> 
> style "gtk-progressbar-style" {
>   bg[NORMAL] = "#ffffff"
>   bg[PRELIGHT] = "#a0a0a0"
> }
> 
> class "GtkProgressBar" style "gtk-progressbar-style"
> 
> 
> To provide some more contrast. So, on Red Hat, at least, the bar is
> dark by default, even though it is drawn with the prelight color.
> 
> But, yes, gtk_widget_modify_style() is the right way to override these
> colors in a program. (Sounds a little ugly to me, but tastes vary.)
> 
> Regards,
>                                         Owen
> 
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list
> 





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