2019-03-30, 16:38
I want to reuse the DialogSelect window without having to go in and recreate the full XML. I just want to hook into the "onAction" and "onClick" handlers to do some other things.
This is the smallest example I could get of the problem: it opens the dialog and then you can't focus on the list (control ID #3 of DialogSelect.xml) at all. Why is that?
How can I make it so the list is focusable and behaves as if I just called with xbmcgui.Dialog().select() ?
This is the smallest example I could get of the problem: it opens the dialog and then you can't focus on the list (control ID #3 of DialogSelect.xml) at all. Why is that?
How can I make it so the list is focusable and behaves as if I just called with xbmcgui.Dialog().select() ?
python:
# -*- coding: utf-8 -*-
import xbmc
import xbmcgui
class CustomDialogSelect(xbmcgui.WindowXMLDialog):
def __init__(self, *args, **kwargs):
xbmcgui.WindowXMLDialog.__init__(self, *args, **kwargs)
def onInit(self):
self.getControl(3).addItems(('Item 1', 'Item 2', 'Item 3'))
self.getControl(5).setLabel('My Label')
def onClick(self, controlId):
xbmc.log(str(controlId), xbmc.LOGNOTICE)
self.close()
if __name__ == '__main__':
ui = CustomDialogSelect('DialogSelect.xml', '') # Use the DialogSelect.xml from the built-in skin, not the add-on.
ui.doModal()
del ui