Window Properties manipulated as numericals values (increment / decrement etc)
#1
Not sure if this has come up before. Googling didn't yield much.

I'd like to manipulate a property that is treated in script as a numerical.

Currently I call the script with an added fudge factor in sys.argv to increment or decrement the property.

This kind of feels a bit squiffy.

It would be better if I could just do it in the skin:

Code:
<onclick>SetProperty(XXX, Window.Property(XXX) + 1</onclick>

Is it possible?
Reply
#2
nope.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Yeah I thought not. Script butchery it is.
Reply
#4
Solution:

Code:
    <control type="button" id="2000">
        <onright>SetProperty(Button, $VAR[IncrementButton])</onright>
    </control>
.
.
.
    <variable name="IncrementButton">
        <value condition="StringCompare(Window.Property(Button),0)">1</value>
        <value condition="StringCompare(Window.Property(Button),1)">2</value>
        <value condition="StringCompare(Window.Property(Button),2)">3</value>
        <value condition="StringCompare(Window.Property(Button),3)">4</value>
        <value condition="StringCompare(Window.Property(Button),4)">4</value>
    </variable>

    <variable name="DecrementButton">
        <value condition="StringCompare(Window.Property(Button),0)">0</value>
        <value condition="StringCompare(Window.Property(Button),1)">0</value>
        <value condition="StringCompare(Window.Property(Button),2)">1</value>
        <value condition="StringCompare(Window.Property(Button),3)">2</value>
        <value condition="StringCompare(Window.Property(Button),4)">3</value>
    </variable>

Tested working in Frodo.

Only works if you know the range, and the range is reasonably finite.
Reply

Logout Mark Read Team Forum Stats Members Help
Window Properties manipulated as numericals values (increment / decrement etc)0