Progressbar color?

hi, this is a basic problem I think but I try to do this for long time.
after I declare

progress = ProgressBar.new

I use

progress.modify_fg(STATE_NORMAL,Gdk::Color.new(240255,208255,215*255))

but it’s nothing happen

and when I do

progress.modify_bg(STATE_NORMAL,Gdk::Color.new(240255,208255,215*255))

color of background of progress bar is a color but I want color at bar
how can I do that?? see my picture for detail.

Hi,

In [email protected]
“[ruby-gnome2-devel-en] progressbar color??” on Tue, 20 May 2008
12:17:35 +0200,
Pat K. [email protected] wrote:

progress.modify_fg(STATE_NORMAL,Gdk::Color.new(240255,208255,215*255))

but it’s nothing happen

and when I do

progress.modify_bg(STATE_NORMAL,Gdk::Color.new(240255,208255,215*255))

color of background of progress bar is a color but I want color at bar
how can I do that?? see my picture for detail.

Use Gtk::STATE_PRELIGHT.

Thanks,

kou

2008/5/20 Kouhei S. [email protected]:

In [email protected]
“[ruby-gnome2-devel-en] progressbar color??” on Tue, 20 May 2008 12:17:35 +0200,
Pat K. [email protected] wrote:

[snipped]
color of background of progress bar is a color but I want color at bar
how can I do that?? see my picture for detail.

Use Gtk::STATE_PRELIGHT.

IIRC, there’s no guarantee that this will work: it will depend on the
GTK theme the user has configured. (Pixmap themes, for example, will
definitely ignore this - the progress bar is simply an composite of
bitmaps).

If having a particular colour for the bar is really essential, it
would be safer to draw your own using cairo.

HTH,

Geoff.

Le mardi 20 mai 2008 à 16:03 +0100, Geoff Y. a écrit :

IIRC, there’s no guarantee that this will work: it will depend on the
GTK theme the user has configured. (Pixmap themes, for example, will
definitely ignore this - the progress bar is simply an composite of
bitmaps).

If having a particular colour for the bar is really essential, it
would be safer to draw your own using cairo.

You can also enforce the theme for that widget

thank you! STATE_PRELIGHT is work!! and I want to know what’s different
of STATE_PRELIGHT and STATE_NORMAL??

2008/5/20 Pat K. [email protected]:

and when I do

progress.modify_bg(STATE_NORMAL,Gdk::Color.new(240255,208255,215*255))

color of background of progress bar is a color but I want color at bar
how can I do that?? see my picture for detail.

Hi all, I’ve just joined the list.

Try calling progress.modify_bg with STATE_PRELIGHT instead of
STATE_NORMAL.

On Mon, May 26, 2008 at 5:47 PM, Pat K.
[email protected] wrote:

thank you! STATE_PRELIGHT is work!! and I want to know what’s different
of STATE_PRELIGHT and STATE_NORMAL??

There’s API documentation for that.

http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk#GtkStateType


Guillaume C. - Guillaume Cottenceau