diff --git a/src/pubsub.py b/src/pubsub.py index 0b8b02c5..30ffd624 100644 --- a/src/pubsub.py +++ b/src/pubsub.py @@ -183,7 +183,7 @@ class PubsubBrowserTab(tabs.Tab): node’s items """ columns = self.item_list_header.get_columns() - self.item_listview.lines = [] + self.item_listview.empty() log.debug('display_items_from_node: %s' % node.items) for item in node.items: self.item_listview.lines.append(item.to_dict(columns)) diff --git a/src/windows.py b/src/windows.py index 512b6f01..9f6fc676 100644 --- a/src/windows.py +++ b/src/windows.py @@ -1512,6 +1512,14 @@ class ListWin(Win): self._selected_row = 0 self._starting_pos = 0 # The column number from which we start the refresh + def empty(self): + """ + emtpy the list and reset some important values as well + """ + self.lines = [] + self._selected_row = 0 + self._starting_pos = 0 + def resize_columns(self, dic): """ Resize the width of the columns