From 091ec16ab595a4ff4caef949c492e9f3d2b507f7 Mon Sep 17 00:00:00 2001 From: Walther Neuper Date: Tue, 15 Dec 2009 13:43:46 +0000 Subject: collect_table --> calc; switch exerc works --- diff --git a/ReckonPrimer.activity/display.py b/ReckonPrimer.activity/display.py index 659036b..b664c02 100755 --- a/ReckonPrimer.activity/display.py +++ b/ReckonPrimer.activity/display.py @@ -184,17 +184,14 @@ class Display: self.feedback_table.attach(self.progress_total, 5, 6, 9, 10 ) self.progress_total.show() - ### START BUTTON BEGIN ### - # works on feedback_+ settings_table: beware of show/hide/destroy them - self.start_button = gtk.Button(None, gtk.STOCK_GO_FORWARD) - self.start_button.connect("clicked", self.clicked_start_callback) - self.feedback_table.attach(self.start_button, 0, 6, 14, 15) - self.start_alignment = self.start_button.get_children()[0] - self.start_hbox = self.start_alignment.get_children()[0] - self.start_image, self.start_label = self.start_hbox.get_children() - self.start_label.set_label("") - self.start_button.show() - ### START BUTTON END ### + self.sfb_butt = gtk.Button(None, gtk.STOCK_GO_FORWARD) + self.sfb_butt.connect("clicked", self.release_feedb_callback) + self.feedback_table.attach(self.sfb_butt, 0, 5, 14, 15) + self.sfb_alignment = self.sfb_butt.get_children()[0] + self.sfb_hbox = self.sfb_alignment.get_children()[0] + self.sfb_image, self.sfb_label = self.sfb_hbox.get_children() + self.sfb_label.set_label("feedback_table") + self.sfb_butt.show() def feedback_table_hide(self): self.progressbar.set_fraction(0) @@ -205,6 +202,7 @@ class Display: self.correct_counter.hide() self.false_counter.hide() self.progress_total.hide() + self.sfb_butt.hide() def offer_setting(self,ex): """ Prepare display for update of settings. """ @@ -216,31 +214,21 @@ class Display: self.current_exercise.define_buttons() self.current_exercise.set_buttons(self._sett) - def clicked_start_callback(self, widget): - """ .start_button switches settings_ / feedback_table. """ - if self.running == False: - self.running = True - self.start_button.set_label(gtk.STOCK_STOP) #stop-button - self.start_alignment = self.start_button.get_children()[0] - self.start_hbox = self.start_alignment.get_children()[0] - self.start_image, self.start_label = self.start_hbox.get_children() - self.start_label.set_label("") - self._co.notify(('setting-done', self._sett))# difference from here - self.settings_table.hide() - self.collection_table.hide() - self.feedback_table_show() - elif self.running == True: - self.protocol('----------------------------------------', 0, 'OK') - self.running = False - self.start_button.set_label(gtk.STOCK_GO_FORWARD)# >-button - self.start_alignment = self.start_button.get_children()[0] - self.start_hbox = self.start_alignment.get_children()[0] - self.start_image, self.start_label = self.start_hbox.get_children() - self.start_label.set_label("") - self.calc_table.destroy() # difference from here - self.feedback_table_hide() - self.settings_table.show() - self.collection_table.show() + def release_feedb_callback(self, widget): + """ """ + self.protocol('----------------------------------------', 0, 'OK') + print('in dsiplay.clicked_start_callback') + self.calc_table.destroy() + self.feedback_table_hide() + self.collection_table.show() # from here the next user-interactions + + def release_sett_callback(self, widget): + """ Start calcs with these settings (probably updated). """ + self._co.notify(('setting-done', self._ex._sett)) + self.settings_table.hide() + #self.collection_table.hide() + self.feedback_table_show() + def init_calc(self): """ @@ -268,16 +256,6 @@ class Display: mark = self.log_buffer.create_mark(None, end_iterator, True) self.log_view.scroll_mark_onscreen(mark) -# def dis_calc(self, clist, cursor, errs): -# _i, _calc = 0, '' -# for _c in clist: -# _i = _i + 1 -# if (_i == cursor) & (errs > 0): -# _calc = _calc + '_' -# else: -# _calc = _calc + _c -# return _calc + ' ' + errs * '/' - def input_digit(self, widget, dig, proterr, protok): """callback: input a digit and give feedback. The _only_ other active widget is the -button on the right""" @@ -393,7 +371,7 @@ class Display: self.flc_alignment = self.flc_butt.get_children()[0] self.flc_hbox = self.flc_alignment.get_children()[0] self.flc_image, self.flc_label = self.flc_hbox.get_children() - self.flc_label.set_label("") + self.flc_label.set_label("finish_learner_coll") self.flc_butt.show() pass -- cgit v0.9.1