Added explanation of how the default args converter is used in the kv example.

This commit is contained in:
Jeff Pittman 2012-08-01 11:08:00 -05:00
parent 7da7432600
commit eb6463a368
2 changed files with 13 additions and 3 deletions

View File

@ -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)

View File

@ -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)