[pygtk] Scraping colors from the current theme

Someone 3m0mdpc02 at sneakemail.com
Tue Aug 5 12:04:43 WST 2008


I wanted to try my hand at writing a script to read the color scheme from
Gnome and write it to Wine, but I haven't been very successful, even with
much of the work done for me.  (I am the beginnerest of Python beginners,
and thought it would be as simple as reading the colors from one file and
translating them into the format expected by the other file.  I guess not.)

See http://ubuntuforums.org/showthread.php?p=5506889#post5506889 for the
current script and more details.

I based the script on someone else's, but while some of their color mappings
work, others are not right.  With the Ubuntu Human theme, for instance,
this:

menu1 = gtk.Menu()
menuitem1 = gtk.MenuItem()
menu1.add(menuitem1)
menustyle = menuitem1.style
menuselection = menustyle.bg[gtk.STATE_SELECTED]

gives me a blue color, when the selected menu background is actually
yellow.  I also don't know how to read the tooltip color:

tooltips1 = gtk.Tooltips()
tooltipstyle = tooltips1.style
<type 'exceptions.AttributeError'>: 'gtk.Tooltips' object has no attribute
'style'

Other colors I don't even think are part of PyGTK, like the Gnome desktop
color, and window manager colors like the title bar and borders.  Can you
confirm this for me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080805/06c0c7cc/attachment.htm 


More information about the pygtk mailing list