I have the following code, that uses pygtk:
attr = pango.AttrList()
attr.change(pango.AttrSize((
50 * window_height / 100) * 1000, 0, -1))
attr.change(pango.AttrFamily("Sans", 0, -1))
attr.change(pango.AttrWeight(pango.WEIGHT_BOLD, 0, -1))
attr.change(pango.AttrForeground(65535, 65535, 65535, 0, -1))
self.label.set_attributes(attr)
I'm trying to port it to pygobject, but there is no class Pango.AttrFamily, neither Pango.AttrWeight, neither Pango.AttrForeground (and I can not instantiate a Pango.AttrSize).
The question is: how to use pango_attr_size_new
, pango_attr_weight_new
, pango_attr_family_new
and pango_attr_foreground_new
through instrospection?
I know I could use markup to do this, but 1. using attributes would keep things simpler and 2. I want to know what is happening here! I've already spent a lot of time trying to solve it.
#mylabel {color:blabla; etc;}
, setself.label.set_name("mylabel")
and then importing the CSS fileGtk.CssProvider.load_from_file(Gtk.CssProvider_get_default(), file)
. – Fatten