I don't understand ListItem
#1
Hi,

I'm trying to reskin my weather. In the MyWeather.xml I see the list of forecast intervals (days, hours etc) is built up using a generic ListItem.

Eg,

Code:
<label>$INFO[ListItem.Label]</label>
...
<texture>$INFO[ListItem.ActualIcon]</texture>
...
<label>$INFO[ListItem.Property(HighTemp)]</label>
...
<visible>!IsEmpty(ListItem.Property(HighTemp))</visible>

and so on.

In the weather script (default.py) I build make calls to setProperty eg
Code:
WEATHER_WINDOW.setProperty("Day0.Title", "Monday")
WEATHER_WINDOW.setProperty("Day1.Title", "Tuesday")

So what's the link between ListItem and the properties I'm setting in the script? How does it know that DayX is a list and that X can range from 0 to 6? How does it know to split the string of the property I set, so the part after the period becomes a fetchable property in the skin for each list entry?

OK reading further it seems to be done with the <content> and <item> tags...
Reply
#2
listitem points to .. items in a list. in this case, the list of days.

from the script we transfer all the properties, then these are copied to properties for the items in the list in the code.
Reply
#3
yep I added a comment to my original post. The actual transfer of values is done with <content> and <item> elements.

Eg:
Code:
<content>
    <item>
        <property name="HighTemp">$INFO[Window.Property(Day0.HighTemp)]</property>
        <property name="LowTemp">$INFO[Window.Property(Day0.LowTemp)]</property>
        <property name="Outlook">$INFO[Window.Property(Day0.Outlook)]</property>
        <property name="TempUnits">$INFO[System.TemperatureUnits]</property>
    </item>
...
</content>
Reply

Logout Mark Read Team Forum Stats Members Help
I don't understand ListItem0