projects
/
matthijs
/
upstream
/
mobilegtd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18b26fe
)
Add ListView.selected_item helper.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Tue, 3 Nov 2009 14:53:54 +0000
(15:53 +0100)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Tue, 3 Nov 2009 14:53:54 +0000
(15:53 +0100)
src/gui/gui.py
patch
|
blob
|
history
diff --git
a/src/gui/gui.py
b/src/gui/gui.py
index f7ee31e78f89eed14e89f3b80b6d973dc4aa9f8a..3d4e6fb9e605627ad789dcbe7ce00b4398c88b35 100644
(file)
--- a/
src/gui/gui.py
+++ b/
src/gui/gui.py
@@
-251,6
+251,13
@@
class ListView(View):
""" Changes the currently selected item to index. """
self.view.set_list(self.items(),index % len(self.items()))
+ def selected_item(self):
+ """ Returns the (title of the) currently selected list item. """
+ if not self.items_cache:
+ return None # No items, so none is selected.
+ return self.items_cache[self.selected_index()]
+
+
def selected_index(self):
""" Returns the currently selected index. """
if not self.current_index is None: