2019-07-23, 08:22
Ok, so, found a solution for most anything I want to set dynamically that has not been working in addon skins. (For example, also found using textColor in the setLabel() for a label control does not work right).
Storing colors in an xml like a Skin Addon does, I can pull and set them like so using window properties:
In the XML:
In the Python:
Storing colors in an xml like a Skin Addon does, I can pull and set them like so using window properties:
In the XML:
xml:
<control type="label" id="1">
<left>4</left>
<top>25</top>
<width>908</width>
<height>40</height>
<textcolor>$INFO[Window().Property(dhtext)]</textcolor>
<textoffsetx>15</textoffsetx>
<align>center</align>
</control>
In the Python:
python:
class OK_Dialog(xbmcgui.WindowXMLDialog):
# until now we have a blank window, the onInit function will parse your xml file
def onInit(self):
self.colors = themecontrol.ThemeColors()
self.title = 1
self.body = 2
self.getControl(self.title).setLabel('Header Test')
self.setProperty('dhtext', self.colors.dh_color)
self.getControl(self.body).setText('Body Test.')
xbmc.sleep(100)
# this puts the focus on the top item of the container
self.setFocusId(self.getCurrentContainerId())
xbmc.executebuiltin("Dialog.Close(busydialog)")