문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top