Python Forum
[Kivy] args converter-help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [Kivy] args converter-help (/thread-8345.html)



args converter-help - antonmichel - Feb-15-2018

hey guys,

I am making a mobile app using kivy, but I cannot understand how the args converter works!, I want it to make my main list work. I read a lot but I think there is no much information about it.
after 'text': when we use x, rec or , ... etc.? and when do we use \ before the brackets?
maybe it is a simple thing but I am a bit new to python and kivy any help ??

list_item_args_converter = lambda row_index, x: {'text': x,
                                                 'size_hint_y': None,
                                                 'height': 25}
args_converter = lambda row_index, rec: \
        {'text': rec['text'],
         'size_hint_y': None,
         'height': 25,
         'cls_dicts': [{'cls': ListItemButton,
                        'kwargs': {'text': rec['text']}},
                       {'cls': ListItemLabel,
                        'kwargs': {'text': rec['text'],
                                   'is_representing_cls': True}},
                       {'cls': ListItemButton,
                        'kwargs': {'text': rec['text']}}]}
thank you