Skip to content

Instantly share code, notes, and snippets.

@amalgamatedclyde
Created October 11, 2013 12:40
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/6933947 to your computer and use it in GitHub Desktop.
Save amalgamatedclyde/6933947 to your computer and use it in GitHub Desktop.
why doesn't this code update my listadapter?
here is my listadapter using an objectProperty:
class studentDetailsAdapter(ListAdapter):
SDA = ObjectProperty(None)
def __init__(self, **kwargs):
super(studentDetailsAdapter, self).__init__(**kwargs)
self.args_converter = lambda row_index, rec: {'text': rec,
class studentDetailsAdapter(ListAdapter):
SDA = ObjectProperty(None)
def __init__(self, **kwargs):
super(studentDetailsAdapter, self).__init__(**kwargs)
self.args_converter = lambda row_index, rec: {'text': rec,
'size_hint_y': None,
'text_size': (200, 30),
'deselected_color': [1, 1, 1, 1],
'selected_color': [0, 0, 1, 1],
'font_size': 20,
'height': 50}
'size_hint_y': None,
'text_size': (200, 30),
'deselected_color': [1, 1, 1, 1],
'selected_color': [0, 0, 1, 1],
'font_size': 20,
'height': 50}
this is the callback:
def callback(instance):
try:
detailsList= StudentDetail(lastname(instance.text), firstname(instance.text))
SDA= studentDetailsAdapter(data= formatlist(detailsList), cls= ListItemLabel)
print 'SDA data is', SDA.data
StudentPhoto.source= photoName(detailsList[6])
StudentPhoto.allow_stretch= True
StudentPhoto.scale = 2
return True
except (IndexError, AttributeError):
StudentPhoto.source= '/home/clyde/kids/765-default-avatar.png'
the callback prints to the terminal when my button is pressed but does not update the listadapter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment