Skip to content

Instantly share code, notes, and snippets.

@amalgamatedclyde
Created November 2, 2013 12:44
Show Gist options
  • Save amalgamatedclyde/7278538 to your computer and use it in GitHub Desktop.
Save amalgamatedclyde/7278538 to your computer and use it in GitHub Desktop.
here is the args_converter and the kv line for the listview
def my_args_converter(row_index, rec):
dict = {'text': '',
'index': rec[4],
'is_selected': rec.is_selected,
'padding_x': 100,
'halign': 'left',
'size_hint_y': None,
'cls_dicts': [{'cls': ImageButton, 'kwargs': {'source': '/home/clyde/' + rec[3], 'index': rec[4], 'size_hint': (.175,1),
'border_color': [0,0,0,1], 'deselected_color': [3,0,0,1], 'selected_color': [0, 6,.0,1], 'on_release' : callback}},
{'cls': ListItemLabel,
'kwargs': {'text': (rec[0])+', '+ rec[1], 'font_size': 24,
'padding_x': -100, 'text_size': (300,60),
'halign': 'left', 'index': rec[4],'index': rec[4],}}]}
return dict
ListView:
adapter: ListAdapter(data = getRow(), args_converter = my_args_converter, cls= CompositeListItem, selection_mode= 'multiple', propagate_selection_to_data= True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment