v17 How to get ListItem object
#1
This thread
http://forum.kodi.tv/showthread.php?tid=250936
details additional functionality enabling addons to set details into a listitem.
But how does an addon get the listitem in the first place?

PHP Code:
# get active window
    
wid xbmcgui.getCurrentWindowId()
    
win xbmcgui.Window(wid)
    
# get focused control
   
cid win.getFocusId() 

Now what? How do I get from the control id. to the actual listitem?
TIA for any clues.
Reply
#2
Code:
control = win.getFocus()
listitem = control.getSelectedItem()

keep in mind you can only do this on lists created by python.
it's not possible to modify listitems in any of the lists created by kodi.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Thanks ronie.
I was beginning to suspect this. So I'm barking up the wrong tree :-{
Drat!
Reply

Logout Mark Read Team Forum Stats Members Help
How to get ListItem object0