Question

I have a project in Python 2.7 and PyGTK 2.24.

I have the following code in my project:

    expTSet = gtk.Expander()
    expTSet.set_use_markup(True)
    expTSet.set_label('<span font_family="serif" size="18" weight="bold">Teacher Settings</span>')
    settingFixed.put(expTSet, 30, 200)
    expTSet.show()

The expander itself appears, but the label does not. What am I doing wrong? How do I make the expander's label visible?

Was it helpful?

Solution

Pango font sizes are not in points (like HTML/CSS), but rather thousandths of points. So size="18" means your font size is 0.018 points, which is too small to read. Change it to size="18000" and it will work as intended.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top