def _fill_container(container, items, options, id_name):
for item in items:
hbox = gtk.HBox()
label_id = gtk.Label()
label_id.set_text(str(getattr(item, id_name)))
hbox.pack_start(label_id, expand=False)
widget = gtk.RadioButton(label=options[0]) # first widget
hbox.pack_start(widget, expand=False, padding=4)
for option in options[1:]: # create rest of the widgets, use first one as a group
next_widget = gtk.RadioButton(widget, label=option)
hbox.pack_start(next_widget, expand=False, padding=4)
label = gtk.Label()
label.set_text(item.name)
hbox.pack_start(label, padding=16, expand=False)
hbox.show_all()
label_id.hide()
container.pack_start(hbox)
评论列表
文章目录