(2016-09-19, 12:23)woodside Wrote: Not sure if these are what you're looking for...
Code:
xbmc.getInfoLabel('System.CurrentControl')
Works for me to get to get the selected item.
Unfortunately, this will give the currently focused
list, but not the
ListItem
...
Quote:Code:
getSelectedItem(...)
getSelectedItem() --Returns the selected item as aListItem object.
*Note, Same as getSelectedPosition() , but instead of an integer aListItem object
is returned. Returns None for empty lists.
See windowexample.py on how to use this.
example:
- item = cList.getSelectedItem()
To get as an object.
And this whole thread is about how this method doesn't work (still
![Rofl Rofl](https://forum.kodi.tv/images/smilies/rotfl.png)
) for controls that were created in XML.
For my usage, that doesn't work. I am filling a list control in an XML dialog with items via a
<content>
tag, but am unable to retrieve the actual
ListItem
s through any means, as far as I can tell.
I can use JSON-RPC to get various information (basically the same as the standard InfoLabels) for
all the files in a directory, or I can access the InfoLabels the way that I am now (
Container(id).ListItem(position).xxxxx
). Unfortunately, neither of these methods gives the ability to get the original
ListItem
.
To add to the matter, it appears that most of the API for
ControlList
(and probably other controls) is broken when dealing with XML windows. I'm unable to use really any of the methods related to items in a
ControlList
, like
size()
or
getListItem(index)
, the latter of which really seemed like the ticket here.
Honestly, it's not really surprising that this hasn't ever been fully addressed (or addressed at all, maybe?), but it certainly is disappointing