Skip to content

Instantly share code, notes, and snippets.

@amalgamatedclyde
Created October 6, 2013 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalgamatedclyde/6856112 to your computer and use it in GitHub Desktop.
Save amalgamatedclyde/6856112 to your computer and use it in GitHub Desktop.
here is my SimpleListAdapter that i used to override he default one:
class SimpleListAdapter(SimpleListAdapter):
def __init__(self, **kwargs):
super(SimpleListAdapter, self).__init__(**kwargs)
self.args_converter= lambda row_index, x: {'text': x,
'size_hint_y': None,
'color' : [1,1,0,1],
'text_size': (250, 25),
'font_size': 25,
'padding_x': -550,
'halign': 'left',
'height': 3
here is the kv that uses it:
MissingList:
id: missing
adapter: SimpleListAdapter(data= missingList(app.myAdapter.selection, 0), cls= ListItemLabel)
this works fine when i run the app, but when i use Builder.load_file to load the kv file and add it to a ScreenManager i get this error:
BuilderException: Parser: File "grd7.kv", line 139:
...
137: MissingList:
138: id: missing
>> 139: adapter: SimpleListAdapter(data= missingList(app.myAdapter.selection, 0), cls= ListItemLabel)
140:
141:
...
AttributeError: 'NoneType' object has no attribute 'bind'
if i comment out the adapter line it loads into the screenmanager as expected, although without the list of course. what is different?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment