2015-03-18, 13:03
I'm making a addon that's fully gui. The issue i'am running into is using a wraplist. For some reason when i create a item and have a onclick option i can't get it to open another xml file. Also when i try to use the py file to call to open the item button it only works on the wraplist id rather than the item id. Below is the code i'm using any help would be great.
Here is the xml code:
Here is the py code;
Here is the xml code:
Code:
<control type="wraplist" id="8000">
<description>Main List</description>
<left>-50</left>
<top>25</top>
<width>4000</width>
<height>4000</height>
<ondown>5555</ondown>
<onup>4444</onup>
<visible>true</visible>
<pagecontrol>-</pagecontrol>
<scrolltime>300</scrolltime>
<focusposition>1</focusposition>
<movement>1</movement>
<orientation>horizontal</orientation>
<itemlayout height="360" width="200">
<control type="image">
<left>50</left>
<top>175</top>
<width>260</width>
<height>350</height>
<texture colordiffuse="FF969096">$INFO[ListItem.Icon]</texture>
</control>
<control type="label">
<left>50</left>
<top>460</top>
<width>260</width>
<font>font13</font>
<textcolor>white</textcolor>
<shadowcolor>ff000000</shadowcolor>
<align>center</align>
<label colordiffuse="FF969096">$INFO[ListItem.Label]</label>
</control>
</itemlayout>
<focusedlayout height="360" width="200">
<control type="image">
<left>50</left>
<top>175</top>
<width>260</width>
<height>350</height>
<animation effect="zoom" end="135" center="200,360" time="200">Focus</animation>
<texture>$INFO[ListItem.Icon]</texture>
</control>
<control type="label">
<left>50</left>
<top>460</top>
<width>260</width>
<font>font13</font>
<textcolor>white</textcolor>
<shadowcolor>ff000000</shadowcolor>
<align>center</align>
<animation effect="zoom" end="135" center="200,360" time="200">Focus</animation>
<label>$INFO[ListItem.Label]</label>
</control>
</focusedlayout>
<content>
<item id="1">
<label>MOVIES</label>
<icon>movie_image.png</icon>
<thumb>movie_image.png</thumb>
<onclick>ActivateWindow(script-kodiaddon-movie.xml)</onclick>
<visible>true</visible>
</item>
<item id="2">
<label>TV SHOWS</label>
<icon>tvshow_image.png</icon>
<thumb>tvshow_image.png</thumb>
<onclick>-</onclick>
</item>
</content>
</control>
Here is the py code;
Code:
def onAction(self,action):
#print "ACTION: " + str(action.getId()) + " FOCUS: " + str(self.getFocusId()) + " BC: " + str(action.getButtonCode())
if action == ACTION_CONTEXT_MENU:
self.doMenu()
elif action == ACTION_SELECT_ITEM:
if self.getFocusId() == 8000:
w = Main_Menu("script-kodiaddon-movie.xml" , __addon__.getAddonInfo('path'), "Default")
w.doModal()
del w
elif self.getFocusId() == 8005:
w = Main_Menu("script-kodiaddon-tvshows.xml" , __addon__.getAddonInfo('path'), "Default")
w.doModal()
del w