def __init__(self, teacher): abstract.LessonbasedGui.__init__(self, teacher) ################ # practise_box # ################ self.g_music_displayer = mpd.MusicDisplayer() self.practise_box.pack_start(self.g_music_displayer, False, False, 0) self.g_bb = QuestionNameButtonTable(self.m_t.m_exname) self.practise_box.pack_start(self.g_bb, False, False, 0) self.g_flashbar = gu.FlashBar() self.g_flashbar.show() self.practise_box.pack_start(self.g_flashbar, False, False, 0) self.practise_box.set_spacing(gu.PAD) self.std_buttons_add( ('new', self.new_question), ('play_music', lambda w: self.run_exception_handled(self.m_t.m_P.play_question)), ('repeat', lambda w: self.run_exception_handled(self.m_t.m_P.play_question)), ('repeat_arpeggio', lambda w: self.run_exception_handled(self.m_t.m_P.play_question_arpeggio)), ('repeat_slowly', lambda w: self.run_exception_handled(self.m_t.m_P.play_question_slowly)), ('play_tonic', lambda w: self.run_exception_handled(self.m_t.play_tonic)), ('display_music', self.show_answer), ('show', self.show_answer), ('give_up', self.give_up), ) self.practise_box.show_all() ############## # config_box # ############## self.config_box.set_border_width(12) self.config_box.set_spacing(18) self.add_random_transpose_gui() # ----------------------------------------- self.g_select_questions_category_box, category_box= gu.hig_category_vbox( _("Questions to ask")) self.config_box.pack_start(self.g_select_questions_category_box, False, False, 0) self.g_select_questions = QuestionNameCheckButtonTable(self.m_t) self.g_select_questions.initialize(4, 0) category_box.pack_start(self.g_select_questions, False, False, 0) self.g_select_questions.show() # ------------------------------------------ self._add_auto_new_question_gui(self.config_box) # ---------------------------------------------- ############## # statistics # ############## self.setup_statisticsviewer(statisticsviewer.StatisticsViewer, _("Identify by name")) def _f(varname): self.m_t.q_status = self.QSTATUS_NO self.setup_action_area_buttons() self.add_watch('ask_for_names', _f)
def __init__(self, teacher): abstract.LessonbasedGui.__init__(self, teacher) ################ # practise_box # ################ self.add_module_is_deprecated_label() self.g_hbox = hbox = gu.bHBox(self.practise_box) hbox.set_spacing(gu.PAD) spacebox = Gtk.HBox() hbox.pack_start(spacebox, True, True, 0) self.g_music_displayer = mpd.MusicDisplayer() self.g_music_displayer.set_size_request(100, -1) hbox.pack_start(self.g_music_displayer, False, False, 0) spacebox = Gtk.HBox() hbox.pack_start(spacebox, True, True, 0) self.g_flashbar = gu.FlashBar() self.practise_box.pack_start(self.g_flashbar, False, False, 0) self.g_new = gu.bButton(self.action_area, _("_New chord"), self.new_question) self.g_repeat = gu.bButton( self.action_area, _("_Repeat"), lambda w: self.run_exception_handled(self.m_t.m_P.play_question)) self.g_repeat_arpeggio = gu.bButton( self.action_area, _("Repeat _arpeggio"), lambda w: self. run_exception_handled(self.m_t.m_P.play_question_arpeggio)) self.g_give_up = gu.bButton(self.action_area, _("_Give up"), self.give_up) self.practise_box.show_all() ############## # config_box # ############## self.config_box.set_spacing(gu.PAD_SMALL) self.add_random_transpose_gui() # ----------------------------------------- self.g_select_questions_category_box, category_box = gu.hig_category_vbox( _("Chord types to ask")) self.config_box.pack_start(self.g_select_questions_category_box, True, True, 0) self.g_select_questions = QuestionNameCheckButtonTable(self.m_t) self.g_select_questions.initialize(4, 0) category_box.pack_start(self.g_select_questions, False, False, 0) self.g_select_questions.show()
def __init__(self, teacher): abstract.LessonbasedGui.__init__(self, teacher) ################ # practise_box # ################ self.g_contents = Gtk.Table() hbox = gu.bHBox(self.practise_box, True, False) hbox.pack_start(Gtk.HBox(), True, True, 0) hbox.pack_start(self.g_contents, True, True, 0) hbox.pack_start(Gtk.HBox(), True, True, 0) self.g_contents.set_col_spacings(gu.PAD) self.g_contents.set_row_spacings(gu.PAD) self.g_music_displayer = mpd.MusicDisplayer() self.g_music_displayer.set_size_request(100, -1) self.g_contents.attach(self.g_music_displayer, 1, 2, 1, 2) self.g_flashbar = gu.FlashBar() self.practise_box.pack_start(self.g_flashbar, False, False, 0) self.std_buttons_add( ('new', self.new_question), ('repeat', lambda w: self.run_exception_handled(self.m_t.m_P.play_question)), ('repeat_arpeggio', lambda w: self.run_exception_handled( self.m_t.m_P.play_question_arpeggio)), ('give_up', self.give_up)) self.practise_box.show_all() ############## # config_box # ############## self.config_box.set_spacing(gu.PAD_SMALL) self.add_random_transpose_gui() # ----------------------------------------- self.g_select_questions_category_box, category_box = gu.hig_category_vbox( _("Chord types to ask")) self.config_box.pack_start(self.g_select_questions_category_box, True, True, 0) self.g_select_questions = QuestionNameCheckButtonTable(self.m_t) self.g_select_questions.initialize(4, 0) category_box.pack_start(self.g_select_questions, False, False, 0) self.g_select_questions.show()