advfilter.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:griffith 作者: Strit 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号