Malcolm Tredinnick wrote:
On Sat, 2004-02-14 at 15:52, Russell Shaw wrote:
[...]

That didn't work for me:

  window=gtk.Window(gtk.WINDOW_TOPLEVEL)
  vbox=gtk.VBox()
  window.add(vbox)
  label=gtk.Label("<b>N</b>ame")
  label.set_use_markup(True);
  vbox.pack_start(label)
  window.show_all()

Cutting and pasting your exact worked for me (bold 'N', normal weight for 'ame'). You did add something like gtk.main() in your main program, right? Otherwise the GTK+ main loop will ever run and nothing will ever be drawn.

Thanks all. The problem was that the bold text for "N" looked barely different to a normal N. Highlighting the whole word made it more noticeable.

#!/usr/bin/python

import sys
import gtk
import pango

def delete_event(widget, event, data=None):
    gtk.main_quit()
    return gtk.FALSE

window=gtk.Window(gtk.WINDOW_TOPLEVEL)
vbox=gtk.VBox()
window.add(vbox)

label=gtk.Label("Name")
attrlist=pango.AttrList()
attr=pango.AttrSize(50000)
attrlist.insert(attr)
attr=pango.AttrWeight(pango.WEIGHT_ULTRABOLD)
attrlist.insert(attr)
label.set_attributes(attrlist)
"""
label=gtk.Label('<span size="50000">N</span>ame')
label.set_use_markup(True);
"""

vbox.pack_start(label)
window.connect("delete_event",delete_event)
window.show_all()
gtk.main()
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to