Davyd ([info]davyd) wrote,
@ 2008-04-02 20:54:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
GTK+ theme colours followup
Following up from my recent post on the topic of accessing GTK+ theme colours. The reason it didn't work was actually quite simple (although I didn't find it documented anywhere). Colours from the theme are not set in a GtkStyle until that widget is realized, during a widget's initialization (or even when ::parent-set is triggered) a widget may not be realized. The correct thing to do is to get the colour when ::realize is triggered. Before ::realize happens, you will get the GTK+ default colours, not the theme colours you were really after.

P.S. It appears that someone was not a fan of my last blog post and is apparently of the opinion that I can't use my blog as a mass communication medium to a group of people that they're not a part of. To this person I say: I will write what I damn well please in my blog. Not every aspect of my life revolves around a computer or the programming thereof, and thus if I want to write about music, politics, the sexuality of penguins in New York, my life, radioactive metals I have previously misplaced or weddings, I will. If you don't want to read it here is a solution.


(Post a new comment)

style-set perhaps?
(Anonymous)
2008-04-02 02:34 pm UTC (link)
Aren't you looking for the style-set signal? That way your widget can even update it's appearance if the global theme changes.

-thos

(Reply to this)(Thread)

Re: style-set perhaps?
[info]davyd
2008-04-02 05:00 pm UTC (link)
Yeah. That has since occurred to me.

(Reply to this)(Parent)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…