
Originally Posted by
bartsidee
At first a comment on the python coding, it is a bit strange that you call your variables using a function. Better would be using a class attribute, dict or list. So instead of mi.itemType() it would be more common to do mi.itemType mi['itemType'] or mi[1].
But if it works for you no problems.
Other than that you code seems fine, so I recon the error is somewhere else, it might give us some insight if you post a bit more from the python part and also the xml section of the list (maybe pastbin is easier for large sections of code)
OK, I switched those methods into properties as you suggested, thanks. Still new to Python, if you couldn't tell. 
Here's my main.xml - it's pretty short so i'll include the whole thing here. 'bz' is a module I've made that handles interfacing with the web service.
Code:
<?xml version="1.0"?>
<window type="window" id="14000">
<defaultcontrol always="true">120</defaultcontrol>
<allowoverlay>no</allowoverlay>
<onload lang="python"><![CDATA[
import mc
import bz
items = bz.getMenuListItems()
bz.log("main.xml got items %s" % items)
mc.GetWindow(14000).GetList(120).SetItems(items)
bz.log("DONE seting list items.")
# mc.GetWindow(14000).GetList(120).SetFocusedItem(0)
]]>
</onload>
<controls>
<control type="group">
<!-- <animation type="WindowOpen">
<effect type="fade" start="0" end="100" time="200" />
</animation> -->
<control type="image">
<width>1280</width>
<height>720</height>
<texture>bg_tmp.png</texture>
</control>
<control type="list" id="120">
<posy>163</posy>
<posx>15</posx>
<width>1250</width>
<height>394</height>
<scrolltime>200</scrolltime>
<orientation>horizontal</orientation>
<itemlayout width="250" height="394">
<control type="image">
<posx>10</posx>
<width>240</width>
<height>240</height>
<texture>$INFO[ListItem.Thumb]</texture>
</control>
</itemlayout>
<focusedlayout width="250" height="394">
<!-- <control type="image">
<animation effect="zoom" end="130" center="auto" time="200">Focus</animation>
<posx>10</posx>
<posy>100</posy>
<width>240</width>
<height>175</height>
<texture>ba_overlay2.png</texture>
<visible>Control.HasFocus(120)</visible>
</control> -->
<control type="image">
<animation effect="zoom" end="120" center="auto" time="200">Focus</animation>
<posx>10</posx>
<width>240</width>
<height>240</height>
<texture>$INFO[ListItem.Thumb]</texture>
<visible>Control.HasFocus(120)</visible>
<bordertexture>ba_overlay2.png</bordertexture>
<bordersize>5</bordersize>
</control>
<control type="label">
<posy>280</posy>
<align>center</align>
<width>240</width>
<height>40</height>
<label>$INFO[ListItem.Title]</label>
<visible>Control.HasFocus(120)</visible>
<font>font21</font>
<scroll>true</scroll>
<textcolor>black</textcolor>
</control>
<control type="image">
<posx>10</posx>
<width>240</width>
<height>240</height>
<texture>$INFO[ListItem.Thumb]</texture>
<visible>!Control.HasFocus(120)</visible>
</control>
<control type="label">
<posy>280</posy>
<align>center</align>
<width>240</width>
<height>40</height>
<label>$INFO[ListItem.Title]</label>
<visible>!Control.HasFocus(120)</visible>
<font>font21</font>
<scroll>false</scroll>
<textcolor>black</textcolor>
</control>
</focusedlayout>
<content type="action">
<onclick lang="python"><![CDATA[
import bz
# mc.GetActiveWindow().PushState()
item = mc.GetActiveWindow().GetList(120).GetItem(mc.GetActiveWindow().GetList(120).GetFocusedItem())
bz.log("Item title: %s, Item image: %s" % (item.GetTitle(), item.GetThumbnail()))
# menuid = item.GetProperty('menuId')
# mc.GetActiveWindow().GetList(120).SetItems(bz.getMenuListItems(menuid))
]]></onclick>
</content>
</control>
</control>
</controls>
</window>
Bookmarks