def create_options_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)
checkbuttons = []
selected_options = value
if constraints is None:
options = []
else:
options = constraints
for option in options:
new_button = gtk.CheckButton(option)
if option in selected_options:
new_button.set_active(True)
checkbuttons.append(new_button)
hbox_main.pack_start(label_text)
for checkbutton in checkbuttons:
hbox_main.pack_start(checkbutton)
self.plugin_config_widgets.append(checkbuttons)
self.plugin_config_traces.append(trace)
sensitivity_group.append(label_text)
sensitivity_group.append(checkbuttons)
return hbox_main
评论列表
文章目录