Hi,
I have a variable number of check buttons and comboboxes I want to add to a window; however, I keep getting memory faults when I try to horizontal box a check button and combobox and then box each one of these vertically. Any help would be appreciated:
Thanks!
I have a variable number of check buttons and comboboxes I want to add to a window; however, I keep getting memory faults when I try to horizontal box a check button and combobox and then box each one of these vertically. Any help would be appreciated:
Code:
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
combobox = gtk.combo_box_new_text()
box1_vbox = gtk.VBox(False, 2)
list_vbox = gtk.VBox(True, 6)
check_hbox = gtk.HBox(True, 6)
buttons_hbox = gtk.HBox(True, 6)
title = gtk.Label("Superimpose models")
for imol in molecule_number_list():
combobox_name = molecule_name(imol)
combobox.append_text(combobox_name)
combobox.connect('changed', sel_ref_mol)
box1_vbox.pack_start(title, False, False)
box1_vbox.pack_start(combobox, False, False)
box1_vbox.pack_start(check_hbox, False, False)
for imol in molecule_number_list():
button_name = molecule_name(imol)
button_imol = gtk.CheckButton(button_name)
combobox_imol = gtk.combo_box_new_text()
button_imol.connect("toggled", moving_mol, imol)
combobox_imol.append_text(combobox_name)
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)
#for imol in molecule_number_list():
box1_vbox.pack_start(check_hbox_imol, False, False)
ok_button = gtk.Button(" Go! ")
cancel_button = gtk.Button(" Cancel ")
cancel_button.connect("clicked", delete_event)
buttons_hbox.pack_start(ok_button, False, False)
buttons_hbox.pack_start(cancel_button, False, False)
box1_vbox.pack_start(buttons_hbox, False, False)
window.add(box1_vbox)
window.show_all()
Comment