FAQ
I want to give some emphasis to a Label from gtk, without breaking gnome
theme (i.e. not changing colors, etc)
I think bolding it would be a good option (could be also underscoring
but don't like it at all).
What would be the best solution? How to do it? I have found how to
change colors and underscoring but nothing else.
Thanks.

Search Discussions

  • Maciej Dziardziel at Sep 25, 2006 at 5:29 pm

    ravenheart wrote:

    I want to give some emphasis to a Label from gtk, without breaking gnome
    theme (i.e. not changing colors, etc)
    I think bolding it would be a good option (could be also underscoring
    but don't like it at all).
    What would be the best solution? How to do it? I have found how to
    change colors and underscoring but nothing else.
    Thanks.
    Just set text to "<b> whatever</b>".

    --
    Maciej "Fiedzia" Dziardziel (maciejdziardziel at poczta.wp.pl)


    Inside his head is a little dust particle with a sign that says 'Space
    for Rent' -Caitieboo
  • MonkeeSage at Sep 25, 2006 at 5:32 pm

    ravenheart wrote:
    What would be the best solution? How to do it? I have found how to
    change colors and underscoring but nothing else.
    I don't know about the best, but I would use:

    label = gtk.Label()
    # Pango markup should be on by default, if not use this line
    #label.set_use_markup(True)
    label.set_markup("<b>Look, I'm bold</b>")

    Regards,
    Jordan
  • Skip at Sep 25, 2006 at 5:42 pm

    I want to give some emphasis to a Label from gtk, without breaking
    gnome theme... What would be the best solution?
    Maybe:

    mylabel.set_markup("""<span weight="bold">My Label</span>""")

    ? For more details, check out the PyGTK docs for the Label widget:

    http://www.moeraki.com/pygtkreference/pygtk2reference/class-gtklabel.html

    and the Pango markup language:

    http://www.moeraki.com/pygtkreference/pygtk2reference/pango-markup-language.html

    Skip
  • Ravenheart at Sep 25, 2006 at 6:06 pm
    Very useful. Thanks a lot

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedSep 25, '06 at 4:52p
activeSep 25, '06 at 6:06p
posts5
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase