[pygtk] Tooltip markup hack
Osmo Salomaa
otsaloma at cc.hut.fi
Tue Nov 14 05:24:11 WST 2006
After some experimentation, I noticed that I can get markup text in
tooltips with the following hack:
def on_notify_use_markup(label, *args):
label.set_use_markup(True)
tooltips = gtk.Tooltips()
tooltips.force_window()
label = tooltips.tip_label
label.set_use_markup(True)
label.connect('notify::use-markup', on_notify_use_markup)
The code firstly calls "force_window" so that the label widget is
created. After that all changes to the label's "use-markup" property are
reverted back to True.
Is this too bad of a hack? Should I be worried that it does not work in
some cases or that it breaks in future versions of GTK?
--
Osmo Salomaa
More information about the pygtk
mailing list