2008-11-24, 14:24
hi!
I have a grouplist defined in a windowxml file like this:
I have tried to dynamically fill this control from a script like this:
It does not work, my xbox just stops responding.
When I dynamically create a "normal list" inside the script, the code from above works:
But I do not want to have to create the list inside the script because I want to have a grouplist.
So my question is: how can I dynamically fill a list which is already defined in a xml?
Or, alternatively, how can I create a grouplist from a script? I only can find ControlList in the pythonLib dir but nothing like a ControlGroupList...
Thanks in advance for your help!!!
I have a grouplist defined in a windowxml file like this:
Code:
<control type="grouplist" id="1210">
<description>Categories</description>
<posx>80</posx>
<posy>60</posy>
<width>250</width>
<height>300</height>
<itemgap>10</itemgap>
<pagecontrol>25</pagecontrol>
<orientation>vertical</orientation>
<usecontrolcoords>false</usecontrolcoords>
<visible>true</visible>
<onup>1210</onup>
<ondown>1210</ondown>
<onleft>1210</onleft>
<onright>1210</onright>
</control>
I have tried to dynamically fill this control from a script like this:
Code:
self.list = self.getControl(1210)
for curItem in itemlist:
item = xbmcgui.ListItem(curItem['name'])
self.list.addItem(item)
It does not work, my xbox just stops responding.
When I dynamically create a "normal list" inside the script, the code from above works:
Code:
self.list = xbmcgui.ControlList(200, 150, 300, 400)
self.addControl(self.list)
But I do not want to have to create the list inside the script because I want to have a grouplist.
So my question is: how can I dynamically fill a list which is already defined in a xml?
Or, alternatively, how can I create a grouplist from a script? I only can find ControlList in the pythonLib dir but nothing like a ControlGroupList...
Thanks in advance for your help!!!