开发者

Pango Markup on Expander Label

I have a project in Python 2.7 and PyGTK 2.24.

I have the following code in my project:

    expTSet = gtk.Ex开发者_运维知识库pander()
    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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜