[SOLVED] Problem with StringCompare
#1
Hi,

I've tried to set a Window Property with the value of a boolean setting, so true or false is stored in this Property.
A recheck by adding a label to the screen containing the getSetting() value and also a debug output shows that
the value is exact "true" or "false" depending on the setting.
But if I try StringCompare as a result filling the Property direct in a visible tag does not work, dosen't work eigher.

Can anyone point me to the coding/skinning error?

Here are a few snippets:

settings.xml:
Code:
<setting id="show_something" type="bool" label="Show the Label" default="true"/>

A peace of code using it to set the Window Property:
Code:
addon       = xbmcaddon.Addon()
WINDOW = xbmcgui.Window( 10000 )
show_something = str(addon.getSetting('show_something'))
WINDOW.setProperty("MyTest.Visible", show_something)

I have tried with (StringCompare):
Code:
<control type="button" id="50101">
                        <include>ButtonHomeSubCommonValues</include>
                        <label>TestButton</label>
                        <visible>StringCompare(Window(Home).Property(MyTest.Visible), true)</visible>
                        <onclick>RunScript(run.plugin.test,"?methode=show")</onclick>
                </control>

and direct Prop

Code:
<control type="button" id="50101">
                        <include>ButtonHomeSubCommonValues</include>
                        <label>TestButton</label>
                        <visible>Window(Home).Property(MyTest.Visible)</visible>
                        <onclick>RunScript(run.plugin.test,"?methode=show")</onclick>
                </control>

Why this does not work?

I added debug output which shows me that StringCompare tests if "true" == "true"
but the button is always hidden ...

Is there a problem with the words "true" and "false" ?

If I use SubString() it works, but why not with StingCompare() ?

regards tdoe
Reply
#2
(2016-03-02, 22:40)tdoe Wrote: Is there a problem with the words "true" and "false" ?

indeed :-)

it's been a known issue for a while and coincidentally we just fixed it yesterday.
https://github.com/xbmc/xbmc/pull/9228
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
Thanks rony for the quick reply!

regards tdoe
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] Problem with StringCompare0