def hig_label_widget(txt, widget, sizegroup, expand=False, fill=False):
"""
Return a box containing a label and a widget, aligned nice
as the HIG say we should. widget can also be a list or tuple of
widgets.
"""
hbox = Gtk.Box()
hbox.set_spacing(hig.SPACE_SMALL)
label = Gtk.Label(label=txt)
label.set_alignment(0.0, 0.5)
if sizegroup:
sizegroup.add_widget(label)
hbox.pack_start(label, False, False, 0)
if not isinstance(widget, (list, tuple)):
widget = [widget]
for w in widget:
hbox.pack_start(w, fill, expand, padding=0)
label.set_use_underline(True)
label.set_mnemonic_widget(widget[0])
return hbox
评论列表
文章目录