summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-06-21 02:01:23 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-06-21 02:01:23 +0200
commit0fa3cf756a50dffe01e46c725245445dc1cfd39b (patch)
treed8443b51a8fe771500de361417c58208f930005c /src
parent06f4dd783ed946168be00abdfdf4ffc127ba21e5 (diff)
downloadpoezio-0fa3cf756a50dffe01e46c725245445dc1cfd39b.tar.gz
poezio-0fa3cf756a50dffe01e46c725245445dc1cfd39b.tar.bz2
poezio-0fa3cf756a50dffe01e46c725245445dc1cfd39b.tar.xz
poezio-0fa3cf756a50dffe01e46c725245445dc1cfd39b.zip
Reset the cursor position from the item list when node changes
Diffstat (limited to 'src')
-rw-r--r--src/pubsub.py2
-rw-r--r--src/windows.py8
2 files changed, 9 insertions, 1 deletions
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