By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,773 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,773 IT Pros & Developers. It's quick & easy.

Getting/setting status of multiple checkbuttons made in loop

100+
P: 127
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?

Expand|Select|Wrap|Line Numbers
  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.  
Oct 22 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.