| FAQ Index - Search - Recent Changes - Everything - Add entry |
7.7. I set my labels to use_markup in glade-2. Why don't they markup the contents I set?
Marking up the contents of a label is a bit tricky. There are two things to wrap your head around:
- always use set_markup() if you want the content you are setting to be parsed as markup -- do NOT use set_text() (it will happily ignore the markup and you will be left in a confused state where will you wander into this FAQ).
- The glade use_markup setting is actually the 'use-markup' gtk.Label GObject property. "use-markup" only controls how to interpret the text given in the 'label' property. label.set_text("foo") is roughly equivalent to:
label.set_property("use-markup", False)
label.set_property("label", "foo")
while label.set_markup("<i>bar</i>") is roughly equivalent to:
label.set_property("use-markup", True)
label.set_property("label", "<i>bar</i>")
