def __init__(self, teacher):
abstract.Gui.__init__(self, teacher)
self.m_key_bindings = {'backspace_ak': self.on_backspace}
self.g_answer_box = Gtk.VBox()
self.answer_buttons = []
self.m_answer_buttons = {}
#-------
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, False,
padding=gu.PAD_SMALL)
self.g_rhythm_viewer = RhythmViewer(self)
self.g_rhythm_viewer.create_holders()
hbox.pack_start(self.g_rhythm_viewer, True, True, 0)
self.practise_box.pack_start(self.g_answer_box, False, False, 0)
# action area
self.std_buttons_add(
('new', self.new_question),
('repeat', self.repeat_question),
#('play_answer', self.play_users_answer),
('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, False,
padding=gu.PAD_SMALL)
self.add_select_num_notes_gui()
#-----
self.config_box.pack_start(Gtk.HBox(), False, False,
padding=gu.PAD_SMALL)
#------
hbox = gu.bHBox(self.config_box, False)
hbox.set_spacing(gu.PAD_SMALL)
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)
hbox = gu.bHBox(self.config_box, False)
hbox.set_spacing(gu.PAD_SMALL)
hbox.pack_start(gu.nCheckButton(self.m_exname,
"show_first_note",
_("Show the first tone")), False, False, 0)
hbox.pack_start(gu.nCheckButton(self.m_exname,
"play_cadence",
_("Play cadence")), False, False, 0)
self._add_auto_new_question_gui(self.config_box)
self.config_box.show_all()
评论列表
文章目录