plugin_config_gui.py 文件源码

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

项目:ecel 作者: ARL-UTEP-OC 项目源码 文件源码
def create_radio_hbox(self, label, value, trace, sensitivity_group, constraints=None):
        hbox_main = gtk.HBox()
        label_text = gtk.Label(label.title())
        label_text.set_alignment(0, 0.5)
        label_text.set_padding(8,8)
        radiobuttons = []
        if constraints is None:
            options = [value]
        else:
            options = constraints
        previous_button = None
        for option in options:
            new_button = gtk.RadioButton(previous_button, option)
            if option == value:
                new_button.set_active(True)
            radiobuttons.append(new_button)
            previous_button = new_button
        hbox_main.pack_start(label_text)
        for radiobutton in radiobuttons:
            hbox_main.pack_start(radiobutton)

        self.plugin_config_widgets.append(radiobuttons)
        self.plugin_config_traces.append(trace)
        sensitivity_group.append(label_text)
        sensitivity_group.append(radiobuttons)

        return hbox_main
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号