String.Compare of a window property
#1
Okay, I am trying to set the visibility of a context menu addon based on a window property.

So I am setting the window property like this:

Code:
xbmcgui.Window(10000).setProperty('SF_MENU_ENABLED', 'True')

and clearing it:

Code:
xbmcgui.Window(10000).clearProperty('SF_MENU_ENABLED')

That is all fine, what I then want is to base the visibilty of my context menu addon on this setting, I was hoping something like this would work:

Code:
<visible>StringCompare($INFO[Window(10000).Property(SF_MENU_ENABLED)],True)</visible>

or maybe

Code:
<visible>StringCompare(Window(10000).Property(SF_MENU_ENABLED),True)</visible>

But no joy Sad

Any ideas would be most appreciated.
Reply
#2
don't use 'True' or 'False' as the value for your window properties.

iirc true/false/yes/no/on/off won't work in stringcompares.
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
(2016-02-14, 22:12)ronie Wrote: don't use 'True' or 'False' as the value for your window properties.

iirc true/false/yes/no/on/off won't work in stringcompares.

Cheers, I'll give that a try. Edit - I can confirm that it works if I use different text, thanks Ronie Smile
(is that behaviour documented?)

As it happens I'd just solved it using this

Code:
<visible>!IsEmpty(Window(10000).Property(SF_MENU_ENABLED))</visible>
Reply
#4
(2016-02-14, 22:12)ronie Wrote: don't use 'True' or 'False' as the value for your window properties.

iirc true/false/yes/no/on/off won't work in stringcompares.

This explains issues I've also encountered...

Thanks for the helpful info Smile
Image Lunatixz - Kodi / Beta repository
Image PseudoTV - Forum | Website | Youtube | Help?
Reply

Logout Mark Read Team Forum Stats Members Help
String.Compare of a window property0