ProgressBar style
| From: | Scott Mattocks | Date: | Wed, 10 Nov 2004 13:59:58 +0000 |
| Subject: | ProgressBar style | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-5206@lists.php.net to get a copy of this message | ||
Hello,
I am having trouble changing the way a GtkProgressBar looks. My problem is similar to this one: http://marc.theaimsgroup.com/?l=php-gtk-general&m=109456816614667&w=2 but I don't think the solution will work. (If I am wrong please let me know)
I can set the background color of the the progress bar but I can't get the bar itself to change colors. I have code like this:
...
$progress =& new GtkProgressBar(0, 0, 1, .1, .1, .1);
$style = $progress->get_style();
$style->bg[GTK_STATE_NORMAL] =& new GdkColor('#FF0000');
$style->fg[GTK_STATE_NORMAL] =& new GdkColor('#00FF00');
$progres->set_style($style);
...
That will set the text to green and the background to red but the bar itself is still the default color. I wouldn't expect the code above to change that but I don't know what I should be setting.
Is it possible to change the color of the bar? From what I understand the bar is really a GtkAdjustment, which isn't a widget. Therefore I can't set the style of the bar. Is that right? Is there any way to change the look of the bar if I can't set the style?
If it isn't possible with GTK 1 is it possible with GTK 2?
Thanks for your help,
--
Scott Mattocks
scott@crisscott.com
http://www.crisscott.com
http://pear.php.net/user/scottmattocks