+ def refresh(self):
+ """
+ Update the gui after a change in model or some user interaction.
+ Should be filled by subclasses.
+ """
+ pass
+
+ def get_menu_entries(self):
+ """ Returns a list of menu entries to display. Will be
+ automatically updated on each refresh.
+
+ Each menu entry is a tuple of a title for the entry and a
+ function to call when the entry is selected.
+ """
+ return []
+
+class ListView(View):
+ def __init__(self):
+ super(ListView, self).__init__()
+ self.set_view(appuifw.Listbox(self.items(),self.entry_selected))
+
+ def entry_selected(self):
+ """
+ This function is called when the user selects an an entry (e.g.,
+ navigates to it and push the ok button).
+ """
+ super(ListView).entry_selected()
+