Note that there are some explanatory texts on larger screens.

plurals
  1. POpango attributes with pygobject
    text
    copied!<p>I have the following code, that uses pygtk:</p> <pre><code>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) </code></pre> <p>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).</p> <p>The question is: how to use <a href="http://developer.gnome.org/pango/stable/pango-Text-Attributes.html#pango-attr-size-new" rel="noreferrer"><code>pango_attr_size_new</code></a>, <a href="http://developer.gnome.org/pango/stable/pango-Text-Attributes.html#pango-attr-weight-new" rel="noreferrer"><code>pango_attr_weight_new</code></a>, <a href="http://developer.gnome.org/pango/stable/pango-Text-Attributes.html#pango-attr-family-new" rel="noreferrer"><code>pango_attr_family_new</code></a> and <a href="http://developer.gnome.org/pango/stable/pango-Text-Attributes.html#pango-attr-foreground-new" rel="noreferrer"><code>pango_attr_foreground_new</code></a> through instrospection?</p> <p>I know I could use <a href="http://developer.gnome.org/gtk3/3.3/GtkLabel.html#id691565" rel="noreferrer">markup</a> 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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload