def update_select_elements_buttons(self):
"""
(Re)create the checkbuttons used to select which rhythm elements
to be used when creating questions. We only need to do this if
we are in m_custom_mode.
"""
for but in self.soltogglebuttons:
but.destroy()
self.soltogglebuttons = []
gs = Gtk.SizeGroup(Gtk.SizeGroupMode.HORIZONTAL)
for i, v in enumerate((
[1, 4, -1, 8, 11, -1, 15, 18, 21, -1, 25, 28, -1, 32],
[0, 3, 6, 7, 10, 13, 14, 17, 20, 23, 24, 27, 30, 31, 34],
[2, 5, -1, 9, 12, -1, 16, 19, 22, -1, 26, 29, -1, 33])):
hbox = Gtk.HBox(True, 0)
for k in v:
b = self.soltogglebutton(k)
gs.add_widget(b)
for n in self.m_t.m_P.header.solmisation_elements:
if k == n:
b.set_active(True)
hbox.pack_start(b, True, True, 0)
self.soltogglebuttons.append(b)
spacing = Gtk.Alignment()
if i in (0, 2):
spacing.set_property('left-padding', 16)
spacing.set_property('right-padding', 16)
spacing.add(hbox)
self.g_select_rhythms_box.pack_start(spacing, True, True, 0)
spacing.show_all()
评论列表
文章目录