2012-06-06, 14:44
I've tried to figure it out for some days now, but I have no clue how to do now. I have a self defined skin which I want to use to show some items. But these does'nt show up. The XMLWindow itself is shown and there are no script-errors in the log (only the notices from the script inside)
Python-Script:
DialogSMS.xml:
How do I reference from Python Code to the Elements (Labels) in the itemlayout? What I'm doing wrong?
Python-Script:
Code:
CAPTION = 30100
LIST = 30106
CLOSE_BUTTON = 30005
class Info(xbmcgui.WindowXMLDialog):
def __init__( self, *args, **kwargs ):
xbmcgui.WindowXML.__init__(self)
def onInit( self ):
print 'onInit triggered'
self.closeButton = self.getControl(CLOSE_BUTTON)
self.getControl(CAPTION).setLabel('SMS Messenger')
self.List = self.getControl(LIST)
for i in range(1,4):
self.List.addItem ('Item %s' % i)
self.List.getSelectedItem().setLabel('ABC')
self.List.getSelectedItem().setLabel2('DEF')
print "added item %s" % i
mydisplay = Info("DialogSMS.xml" ,__xmlpath__)
mydisplay.doModal()
del mydisplay
DialogSMS.xml:
Code:
<control type="list" id="30106">
<posx>213.5</posx>
<posy>140</posy>
<width>854.5</width>
<height>300</height>
<itemgap>0</itemgap>
<onleft>61</onleft>
<onright>5</onright>
<onup>6</onup>
<ondown>6</ondown>
<pagecontrol>61</pagecontrol>
<scrolltime>200</scrolltime>
<itemlayout height="100">
<control type="image">
<posx>0</posx>
<posy>60</posy>
<width>854.5</width>
<height>40</height>
<texture>osd_settings_buttonnf.png</texture>
</control>
<control type="label">
<description>Sender</description>
<textcolor>FF929191</textcolor>
<selectedcolor>FFDAA520</selectedcolor>
<info>ListItem.Label</info>
<label>--</label>
</control>
<control type="label">
<description>Header</description>
<posy>35</posy>
<textcolor>FF929191</textcolor>
<selectedcolor>FFDAA520</selectedcolor>
<info>ListItem.Label2</info>
<label>--</label>
</control>
</itemlayout>
</control>
How do I reference from Python Code to the Elements (Labels) in the itemlayout? What I'm doing wrong?