获取/设置循环中生成的多个复选按钮的状态
嗨,
我有一个创建多个复选按钮的例程。我想添加一个单独的组合框,它在一定程度上更改了此循环中的复选按钮的状态。谁能告诉我一些允许我更改的代码,比如循环中从False到True的第二个复选按钮?
选择 | 换行 | 行号
- for imol in molecule_number_list():
- button_name = molecule_name(imol)
- button_imol = gtk.CheckButton(button_name)
- #button_imol.set_active(False)
- if imol == ref_mol:
- print "XXXX"
- button_imol.set_active(False)
- else:
- button_imol.set_active(True)
- combobox_imol = gtk.combo_box_new_text()
- button_imol.connect("toggled", moving_mol, imol)
- for chain in chain_ids(imol):
- combobox_imol.append_text(chain)
- check_hbox_imol = gtk.HBox(True, 6)
- check_hbox_imol.pack_start(button_imol, False, False)
- check_hbox_imol.pack_start(combobox_imol, False, False)
- box1_vbox.pack_start(check_hbox_imol, False, False)