2020-04-04, 22:01
I have a need in my addon to select and activate a listitem in a certain condition. In python, I have been able to figure out how to select the listitem but not activate it/choose it. Here's what I've tried:
Any way to accomplish what I'm trying to do?
Thanks in advance
python:
wid = xbmcgui.getCurrentWindowId()
win = xbmcgui.Window(wid)
control = win.getFocus()
control.selectItem(1) #This correctly selects the listitem
xbmc.executebuiltin('SendClick(%(current_wid)s,%(current_item)s)'%{'current_wid':wid,'current_item':control}) #Doesn't work, debug shows WARNING: Attempt to use invalid handle xxx
xbmc.executebuiltin('SendClick(%(current_wid)s,%(current_item)s)'%{'current_wid':wid,'current_item':control.getSelectedItem()}) #Doesn't work, debug shows WARNING: Attempt to use invalid handle xxx
xbmc.executebuiltin('SendClick(%(current_item)s)'%{'current_wid':wid,'current_item':control.getSelectedItem()}) #Doesn't work, debug shows WARNING: Attempt to use invalid handle xxx
Any way to accomplish what I'm trying to do?
Thanks in advance