[pygtk] gtk.ProgressBar color

John Stowers john.stowers.lists at gmail.com
Tue Jul 3 14:49:10 WST 2012


On Mon, Jul 2, 2012 at 8:15 PM, Robert Pinsky <rpinsky at imsco-us.com> wrote:
> John, I tried the modify_bg call as follows:
>     self.pbar.modify_bg(gtk.STATE_PRELIGHT, self.pbar.get_colormap().alloc_color("yellow"))
>
> It accepted the command, but did not actually change the color.  (I saw a comment in q_use_statusicon.py file you sent me that says "This does not work for certain gtk/gnome themes".  That sure is disappointing.  Is there a setting change I can make to the theme to make it work?

Not really, otherwise theme authors would then request a setting to
always make their themes work... That is why it is best to write
widgets oneself, to guarantee the appearance.

>
> I have not heard of cairo.  Can you give me an example of cairo code?  Perhaps some code fragment that I can modify into a progress bar with text?

Here are two comprehensive examples

http://zetcode.com/gui/pygtk/customwidget/
http://www.pygtk.org/articles/cairo-pygtk-widgets/cairo-pygtk-widgets.htm

Such a widget shouldn't take you more than a few hours.

John


More information about the pygtk mailing list