Created
October 11, 2013 12:40
-
-
Save amalgamatedclyde/6933947 to your computer and use it in GitHub Desktop.
why doesn't this code update my listadapter?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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