获取/设置循环中生成的多个复选按钮的状态

嗨,
我有一个创建多个复选按钮的例程。我想添加一个单独的组合框,它在一定程度上更改了此循环中的复选按钮的状态。谁能告诉我一些允许我更改的代码,比如循环中从False到True的第二个复选按钮?

选择 | 换行 | 行号
  1.         for imol in molecule_number_list():
  2.             button_name = molecule_name(imol)
  3.             button_imol = gtk.CheckButton(button_name)
  4.             #button_imol.set_active(False)
  5.             if imol == ref_mol:
  6.                 print "XXXX"
  7.                 button_imol.set_active(False)
  8.             else:
  9.                 button_imol.set_active(True)
  10.             combobox_imol = gtk.combo_box_new_text()
  11.             button_imol.connect("toggled", moving_mol, imol)
  12.             for chain in chain_ids(imol):
  13.                 combobox_imol.append_text(chain)
  14.             check_hbox_imol = gtk.HBox(True, 6)
  15.             check_hbox_imol.pack_start(button_imol, False, False)
  16.             check_hbox_imol.pack_start(combobox_imol, False, False)
  17.             box1_vbox.pack_start(check_hbox_imol, False, False)
  18.  

标签: python

添加新评论