Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Solved Set info of a ControlProgress in XML
#1
Dear all,

I am having a hard time trying to set a controlprogress value directly in an xml file. I know I can use .setPercent(x) from python to set the percent of the controlprogress however this control "belongs" to a listitem and its percent should be a property of this listitem.

Supose I want to set the percent of this control (333) as 40% for instance:

PHP Code:
<control type="progress" id="333">
    <
description>Progressbar</description>
    <
left>45</left>
    <
top>187</top>
    <
width>180</width>
    <
height>16</height>
    <
colordiffuse>88FFFFFF</colordiffuse>
    <
info>$INFO[ListItem.Property(my_percent)]</info>
    <
texturebg border="2">osd/texturebg2.png</texturebg>
</
control

I tried to use:

PHP Code:
<info>40</info

PHP Code:
<info>0.4</info

PHP Code:
<info>40.000</info

No luck.

Any help would be appreciated.

Cheers[/quote]
Reply
#2
Ok, a friend helped me out. Here's the solution

Set the control as:

Code:
<control type="progress" id="333">
    <description>Progressbar</description>
    <left>45</left>
    <top>187</top>
    <width>180</width>
    <height>16</height>
    <colordiffuse>88FFFFFF</colordiffuse>
    <info>ListItem.Property(my_percent)</info>
    <texturebg border="2">osd/texturebg2.png</texturebg>
</control>

Then set the property for each listitem

game = xbmcgui.ListItem("my_event")
game.setProperty("my_percent","100")

Results in something like this:

Image

Thanks anyway
Reply
#3
great job!
Kodi 19 + Arctic: Zephyr Reloaded
nVidia SHIELD 2017 + WD My Book
LG OLED65B8PLA + LG SP11RA 7.1.4
Reply

Logout Mark Read Team Forum Stats Members Help
Set info of a ControlProgress in XML0