def _init_action_buttons(self): self.action_buttons = [] action_button_names = ['czytaj', 'literuj', 'następny', 'zamknij'] for col, b in enumerate(action_button_names): one_button = buttons.ActionButton() one_button.set_label(b) one_button.set_icon_from_file('concept/edu/icons/' + b + '.png') one_button.set_hilite_color(self.off_color) self.action_buttons.append(one_button) self.layout.attach(one_button, col, self.word_count + 1, 1, 1) self.action_buttons_count = len(self.action_buttons)
def _init_action_buttons(self): self.action_buttons = [] button_names = [ 'sprawdź', 'skasuj', 'wyczyść', 'czytaj', 'literuj', 'wróć' ] for col, b in enumerate(button_names): one_button = buttons.ActionButton() one_button.set_label(b) one_button.set_icon_from_file('concept/edu/icons/' + b + '.png') one_button.set_hilite_color(self.off_color) self.action_buttons.append(one_button) self.layout.attach(one_button, col, self.letter_grid_row_count, 1, 1)
def set_action_button(self, index, action): button = buttons.ActionButton() button.set_label(action) button.set_icon_from_file(''.join( ['concept/edu/icons/', action, '.png'])) button.set_hilite_color(self.off_color) where = { 'sprawdź': (button, index, self.row_count + 1, 2, 1), 'wróć': (button, index + 1, self.row_count + 1, 2, 1) } try: self.layout.attach(*where[action]) except KeyError: self.layout.attach(button, index + 1, self.row_count + 1, 1, 1) return button