2018-08-12, 04:33
In a python add-on using WindowXML for custom GUI, I'm trying to access focused item (not selected) in a List control.
class GUI(xbmcgui.WindowXML):
def onFocus(self, controlID):
# This method gets triggered when my GUI focus (i.e. no Enter/OK pressed yet) moves to a particular control.
curPanel = self.getControl(controlID). # gets me the Panel that has focus.
# how do I get the item that currently is focussed ?
# curPanel.getSelectedItem() will return a value only when I hit OK on focused item.
I think the information I'm looking for (which item is focused) is available to the GUI because if we move focus to another control (not item in same control) and come back to this Panel, the last focused item on the Panel will again get focus. So somewhere in the GUI, it knows which item was focused.
Thanks in advance.
class GUI(xbmcgui.WindowXML):
def onFocus(self, controlID):
# This method gets triggered when my GUI focus (i.e. no Enter/OK pressed yet) moves to a particular control.
curPanel = self.getControl(controlID). # gets me the Panel that has focus.
# how do I get the item that currently is focussed ?
# curPanel.getSelectedItem() will return a value only when I hit OK on focused item.
I think the information I'm looking for (which item is focused) is available to the GUI because if we move focus to another control (not item in same control) and come back to this Panel, the last focused item on the Panel will again get focus. So somewhere in the GUI, it knows which item was focused.
Thanks in advance.