From fa7009d79d4d7705f21d61ea7d93327c774c4847 Mon Sep 17 00:00:00 2001 From: Jeff Pittman Date: Tue, 31 Jul 2012 10:02:21 -0500 Subject: [PATCH] Added a simple example for listview, that only takes a list of strings. --- examples/widgets/list_simple.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 examples/widgets/list_simple.py diff --git a/examples/widgets/list_simple.py b/examples/widgets/list_simple.py new file mode 100644 index 000000000..036ba905a --- /dev/null +++ b/examples/widgets/list_simple.py @@ -0,0 +1,23 @@ +from kivy.uix.listview import ListView +from kivy.uix.gridlayout import GridLayout + + +class MainView(GridLayout): + '''Implementation of a simple list view with 100 items. + ''' + + def __init__(self, **kwargs): + kwargs['cols'] = 2 + kwargs['size_hint'] = (1.0, 1.0) + super(MainView, self).__init__(**kwargs) + + list_view = ListView([str(index) for index in xrange(100)]) + + self.add_widget(list_view) + + +if __name__ == '__main__': + + from kivy.base import runTouchApp + + runTouchApp(MainView(width=800))