2015-06-24, 13:42
Hello everybody !
I'm pretty new here and I try to build my first addon for kodi.
I have 2 question :
- My addon load an html file from an URL and "parse" it to retrieve some information. Then, it build a list of listItem and push them in a new windowXMLdialog. It works fine but the listItem object is relatively limited with the number of info he can cary (label, label2, path, icon...). How can I send more infos thrue a listItem ? I found a lot of pages about $INFO and I pretty sure it's what I need. I know how to "read" $INFO in my XML but nothing about pushing info in it from my .py script... Can I 'join' some more $INFO label in a listItem object ?
this how I fill my windows until here but I need more attributes to ListItem.
- For each one of my windowXML item, I wish to send the path to a function of my windowsXML class and execute it.
When I click on an item, I want to trigger a function that is define in my window class. I found a lot of thing about triggering a buildin function but nothing about what I want, triggering a custom function. I read something about the runScript statement in the XML file but I didn't succeed to use it properly... Plus, I don't think it's what I need because I don't want to launch another addon but just use a custom Function of the actual addon. How can I do something like this in my XML :
Thanks a lot for reading !
I still looking for a solution by my own ^^.
I'm pretty new here and I try to build my first addon for kodi.
I have 2 question :
- My addon load an html file from an URL and "parse" it to retrieve some information. Then, it build a list of listItem and push them in a new windowXMLdialog. It works fine but the listItem object is relatively limited with the number of info he can cary (label, label2, path, icon...). How can I send more infos thrue a listItem ? I found a lot of pages about $INFO and I pretty sure it's what I need. I know how to "read" $INFO in my XML but nothing about pushing info in it from my .py script... Can I 'join' some more $INFO label in a listItem object ?
this how I fill my windows until here but I need more attributes to ListItem.
Code:
guiListItem = xbmcgui.ListItem (label=Titre, iconImage=ImageURL, label2=durationSTR, path=pathURL)
mainContainer.addItem (guiListItem)
- For each one of my windowXML item, I wish to send the path to a function of my windowsXML class and execute it.
When I click on an item, I want to trigger a function that is define in my window class. I found a lot of thing about triggering a buildin function but nothing about what I want, triggering a custom function. I read something about the runScript statement in the XML file but I didn't succeed to use it properly... Plus, I don't think it's what I need because I don't want to launch another addon but just use a custom Function of the actual addon. How can I do something like this in my XML :
Code:
<focusedlayout height="140" width="210">
<control type="image">
<onclick>MyCustomFunction(param1, param2)</onclick>
</control>
</focusedlayout>
Thanks a lot for reading !
I still looking for a solution by my own ^^.