Getting/setting status of multiple checkbuttons made in loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phub11
    New Member
    • Feb 2008
    • 127

    Getting/setting status of multiple checkbuttons made in loop

    Hi,

    I have a routine that creates multiple checkbuttons. I'd like to add a separate combobox that, in part, changes the status of the checkbuttons made in this loop. Could someone point me to some code that allowd me to change, say the second checkbutton made in the loop from False to True?

    Code:
    		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)
Working...