471,330 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

pygtk theme colors ?

I understand nothing ...
I'm trying to get the color of a normal background window

and when I change my themes (i switch between a light and a dark
theme)
i obtain always the same output below :

style = gtk.Button().get_style()
l=[gtk.STATE_NORMAL,gtk.STATE_ACTIVE,gtk.STATE_PRELIG HT,gtk.STATE_SELECTED,gtk.STATE_INSENSITIVE]
for i in l:
print "- base",i,style.base[i].to_string()
for i in l:
print "- text",i,style.text[i].to_string()
for i in l:
print "- fg",i,style.fg[i].to_string()
for i in l:
print "- bg",i,style.bg[i].to_string()

what's the trouble ?!?
Dec 12 '07 #1
1 3002
I've found ...
In fact, you'll need to "realize" the window, and you should obtain
the real gtk theme style .... (if you didn't realize the window, you
obtain the default gtk theme style)

(I post it here, so i could find it in the future again ;-)

w = gtk.Window()
w.realize()
style=w.get_style()

l=[gtk.STATE_NORMAL,gtk.STATE_ACTIVE,gtk.STATE_PRELIG HT,gtk.STATE_SELECTED,gtk.STATE_INSENSITIVE]
for i in l:
print "- base",i,style.base[i].to_string()
for i in l:
print "- text",i,style.text[i].to_string()
for i in l:
print "- fg",i,style.fg[i].to_string()
for i in l:
print "- bg",i,style.bg[i].to_string()
Dec 12 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Egbert Bouwman | last post: by
1 post views Thread by Brian Hu | last post: by
4 posts views Thread by rawCoder | last post: by
2 posts views Thread by jjack100 | last post: by
2 posts views Thread by Merlin | last post: by
reply views Thread by binaryj | last post: by
4 posts views Thread by Neil Jones | last post: by
1 post views Thread by samatair | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.