def __init__(self, teacher):
abstract.Gui.__init__(self, teacher)
self.m_key_bindings = {'backspace_ak': self.on_backspace}
self.g_answer_box = gu.NewLineBox()
self.practise_box.pack_start(self.g_answer_box, False, False, 0)
#-------
hbox = gu.bHBox(self.practise_box)
b = Gtk.Button(_("Play"))
b.show()
b.connect('clicked', self.play_users_answer)
hbox.pack_start(b, False, True, 0)
self.practise_box.pack_start(Gtk.HBox(False, 0), False, False,
padding=gu.PAD_SMALL)
self.g_rhythm_viewer = RhythmViewer(self)
#FIXME the value 52 is dependant on the theme used
self.g_rhythm_viewer.set_size_request(-1, 52)
self.g_rhythm_viewer.create_holders()
hbox.pack_start(self.g_rhythm_viewer, True, True, 0)
# action area
self.std_buttons_add(
('new', self.new_question),
('repeat', self.repeat_question),
('give_up', self.give_up),
('backspace', self.on_backspace))
self.practise_box.show_all()
##############
# config_box #
##############
self.add_select_elements_gui()
#--------
self.config_box.pack_start(Gtk.HBox(False, 0), False, False,
padding=gu.PAD_SMALL)
self.add_select_num_beats_gui()
#-----
self.config_box.pack_start(Gtk.HBox(False, 0), False, False,
padding=gu.PAD_SMALL)
#------
hbox = gu.bHBox(self.config_box, False)
hbox.set_spacing(gu.PAD_SMALL)
hbox.pack_start(gu.nCheckButton(self.m_exname,
"not_start_with_rest",
_("Don't start the question with a rest")), False, False, 0)
sep = Gtk.VSeparator()
hbox.pack_start(sep, False, False, 0)
hbox.pack_start(Gtk.Label(_("Beats per minute:")), False, False, 0)
spin = gu.nSpinButton(self.m_exname, 'bpm',
Gtk.Adjustment(60, 20, 240, 1, 10))
hbox.pack_start(spin, False, False, 0)
self._add_auto_new_question_gui(self.config_box)
self.config_box.show_all()
评论列表
文章目录