def tree_view_keypress_callback(self, widget, event):
        """Tab back and forward tab-key motion in list widget and the scrollbar motion to follow key cursor motions

         The method introduce motion and edit functionality by using "tab"- or "shift-tab"-key for a Gtk.TreeView.
         It is designed to work with a Gtk.TreeView which model is a Gtk.ListStore and only uses text cell renderer.
         Additional, the TreeView is assumed to be used as a list not as a tree.
         With the "tab"-key the cell on the right site of the actual focused cell is started to be edit. Changes in the
         Gtk.Entry-Widget are confirmed by emitting a 'edited'-signal. If the row ends the edit process continues
         with the first cell of the next row. With the "shift-tab"-key the inverse functionality of the "tab"-key is
         provided.
         The Controller over steps not editable cells.

        :param Gtk.TreeView widget: The tree view the controller use
        :param Gdk.Event event: The key press event
        :return:
        """
        # self._logger.info("key_value: " + str(event.keyval if event is not None else ''))
        if event and "GDK_KEY_PRESS" == event.type.value_name \
                and (event.keyval == Gdk.KEY_Tab or event.keyval == Gdk.KEY_ISO_Left_Tab):
            [path, focus_column] = self.tree_view.get_cursor()
            if not path:
                return False
            self.tree_view_keypress_callback.__func__.core_element_id = self.store[path][self.ID_STORAGE_ID]

            # finish active edit process
            if self.active_entry_widget is not None:
                text = self.active_entry_widget.get_buffer().get_text()
                if focus_column in self.widget_columns:
                    focus_column.get_cells()[0].emit('edited', path[0], text)

            # row could be updated by other call_backs caused by emitting 'edited' signal but selection stays an editable neighbor
            path = self.get_path_for_core_element(self.tree_view_keypress_callback.__func__.core_element_id)
            if event.keyval == Gdk.KEY_Tab:
                # logger.info("move right")
                direction = +1
            else:
                # logger.info("move left")
                direction = -1

            # get next row_id for focus
            if direction < 0 and focus_column is self.widget_columns[0] \
                    or direction > 0 and focus_column is self.widget_columns[-1]:
                if direction < 0 < path[0] or direction > 0 and not path[0] + 1 > len(self.store):
                    next_row = path[0] + direction
                else:
                    return False
            else:
                next_row = path[0]
            # get next column_id for focus
            focus_column_id = self.widget_columns.index(focus_column)
            if focus_column_id is not None:
                # search all columns for next editable cell renderer
                next_focus_column_id = 0
                for index in range(len(self.tree_view.get_model())):
                    test_id = focus_column_id + direction * index + direction
                    next_focus_column_id = test_id % len(self.widget_columns)
                    if test_id > len(self.widget_columns) - 1 or test_id < 0:
                        next_row = path[0] + direction
                        if next_row < 0 or next_row > len(self.tree_view.get_model()) - 1:
                            return False

                    if self.widget_columns[next_focus_column_id].get_cells()[0].get_property('editable'):
                        break
            else:
                return False

            del self.tree_view_keypress_callback.__func__.core_element_id
            # self._logger.info("self.tree_view.scroll_to_cell(next_row={0}, self.widget_columns[{1}] , use_align={2})"
            #              "".format(next_row, next_focus_column_id, False))
            # self.tree_view.scroll_to_cell(next_row, self.widget_columns[next_focus_column_id], use_align=False)
            self.tree_view.set_cursor_on_cell(Gtk.TreePath.new_from_indices([next_row]), self.widget_columns[
                next_focus_column_id], focus_cell=None, start_editing=True)
            return True
        else:
            super(ListViewController, self).tree_view_keypress_callback(widget, event)
def tree_view_keypress_callback ( self , widget , event ) : if event and "GDK_KEY_PRESS" == event . type . value_name and ( event . keyval == Gdk . KEY_Tab or event . keyval == Gdk . KEY_ISO_Left_Tab ) : [ path , focus_column ] = self . tree_view . get_cursor ( ) if not path : return False self . tree_view_keypress_callback . __func__ . core_element_id = self . store [ path ] [ self . ID_STORAGE_ID ] if self . active_entry_widget is not None : text = self . active_entry_widget . get_buffer ( ) . get_text ( ) if focus_column in self . widget_columns : focus_column . get_cells ( ) [ 0 ] . emit ( 'edited' , path [ 0 ] , text ) path = self . get_path_for_core_element ( self . tree_view_keypress_callback . __func__ . core_element_id ) if event . keyval == Gdk . KEY_Tab : direction = + 1 else : direction = - 1 if direction < 0 and focus_column is self . widget_columns [ 0 ] or direction > 0 and focus_column is self . widget_columns [ - 1 ] : if direction < 0 < path [ 0 ] or direction > 0 and not path [ 0 ] + 1 > len ( self . store ) : next_row = path [ 0 ] + direction else : return False else : next_row = path [ 0 ] focus_column_id = self . widget_columns . index ( focus_column ) if focus_column_id is not None : next_focus_column_id = 0 for index in range ( len ( self . tree_view . get_model ( ) ) ) : test_id = focus_column_id + direction * index + direction next_focus_column_id = test_id % len ( self . widget_columns ) if test_id > len ( self . widget_columns ) - 1 or test_id < 0 : next_row = path [ 0 ] + direction if next_row < 0 or next_row > len ( self . tree_view . get_model ( ) ) - 1 : return False if self . widget_columns [ next_focus_column_id ] . get_cells ( ) [ 0 ] . get_property ( 'editable' ) : break else : return False del self . tree_view_keypress_callback . __func__ . core_element_id self . tree_view . set_cursor_on_cell ( Gtk . TreePath . new_from_indices ( [ next_row ] ) , self . widget_columns [ next_focus_column_id ] , focus_cell = None , start_editing = True ) return True else : super ( ListViewController , self ) . tree_view_keypress_callback ( widget , event )
Tab back and forward tab-key motion in list widget and the scrollbar motion to follow key cursor motions

         The method introduce motion and edit functionality by using "tab"- or "shift-tab"-key for a Gtk.TreeView.
         It is designed to work with a Gtk.TreeView which model is a Gtk.ListStore and only uses text cell renderer.
         Additional, the TreeView is assumed to be used as a list not as a tree.
         With the "tab"-key the cell on the right site of the actual focused cell is started to be edit. Changes in the
         Gtk.Entry-Widget are confirmed by emitting a 'edited'-signal. If the row ends the edit process continues
         with the first cell of the next row. With the "shift-tab"-key the inverse functionality of the "tab"-key is
         provided.
         The Controller over steps not editable cells.

        :param Gtk.TreeView widget: The tree view the controller use
        :param Gdk.Event event: The key press event
        :return: