From eb6463a368a7311615288bb7050ef2d950f57936 Mon Sep 17 00:00:00 2001 From: Jeff Pittman Date: Wed, 1 Aug 2012 11:08:00 -0500 Subject: [PATCH] Added explanation of how the default args converter is used in the kv example. --- examples/widgets/lists/list_kv.py | 9 +++++++-- kivy/uix/listview.py | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/widgets/lists/list_kv.py b/examples/widgets/lists/list_kv.py index acde7b63e..7121d6e5f 100644 --- a/examples/widgets/lists/list_kv.py +++ b/examples/widgets/lists/list_kv.py @@ -24,8 +24,13 @@ class MainView(GridLayout): super(MainView, self).__init__(**kwargs) # Here we create a list adapter with some item strings, passing our - # CompositeListItemTemplate for the list item view, and then we create - # a list view using this adapter: + # CompositeListItemTemplate for the list item view, and then we + # create a list view using this adapter. As we have not provided an + # args converter, the default will be used. It will create, per + # list item, an args dict with the text set to the data item (in + # this case a string label for an integer index), and two default + # properties: size_hint_y=None and height=25. To customize, make + # your own args converter and/or customize the kv template. list_adapter = ListAdapter(data=[str(i) for i in xrange(100)], template='CustomListItem') list_view = ListView(adapter=list_adapter) diff --git a/kivy/uix/listview.py b/kivy/uix/listview.py index de86796d2..82fb63345 100644 --- a/kivy/uix/listview.py +++ b/kivy/uix/listview.py @@ -230,7 +230,12 @@ To make a simple list with labels for 100 integers: # Here we create a list adapter with some item strings, passing our # CompositeListItemTemplate for the list item view, and then we - # create a list view using this adapter: + # create a list view using this adapter. As we have not provided an + # args converter, the default will be used. It will create, per + # list item, an args dict with the text set to the data item (in + # this case a string label for an integer index), and two default + # properties: size_hint_y=None and height=25. To customize, make + # your own args converter and/or customize the kv template. list_adapter = ListAdapter(data=[str(i) for i in xrange(100)], template='CustomListItem') list_view = ListView(adapter=list_adapter)