Kodi Community Forum

Full Version: SetProperty \ onfocus not working ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey, I am creating "main menu"
using List control, then <content></content>
inside I put includes to every button.
for every button I want few parameters, like background image and Button icon, label etc.
so with the background I used "thumb\icon" and for the text I used label.
but I want to show "button Icon" (just an image)
for some reason, I cannot get it done.

In the list control, Im trying to add new image control
Code:
                <itemlayout  width="110" height="110">
                    <control type="image">
                        <posx>10</posx>
                        <posy>5</posy>
                        <width>75</width>
                        <height>75</height>
                        <texture background="true">$INFO[Skin.String(SOMETHING)]</texture>
                    </control>
and I tried to set SOMETHING to any image path, and without success. (for example tried "videos.png" and nothing happend)
also try to use "label" control - to show if it will display the String - but again - no success... empty string.
the only way that I can show the label, is if I put the control outside of the "itemlayout" and "focuslayout", but there is no point to do so....
so this is one problem.
the second one, is in the includes items,
why I cant use there "onfocus" ?
the "onclicks" works fine.
but If I use
Code:
        <item id="1">
            <label>Videos</label>
            <onclick>ActivateWindow(Videos,Files)</onclick>
            <onfocus>Skin.SetString(homeicon,videos.png)</onfocus>
            <icon>special://skin/backgrounds/videos.jpg</icon>
            <thumb>$INFO[Skin.String(Videos_Folder)]</thumb>
        </item>
the onfocus part does not work.
I put different values for every item, and the "homeicon" is not changing when I move in the list between buttons... It is remain the same thing (that I set manually).
Also tried to work with "SetProperty" into "home" windows - but it seems that everything in the list is not working....

Just to be clear. the list is inside "include" in the file "includes_home" and in the file "home" i called to that include.
1) <onfocus> tags are not supported for listitems
2) you can only use ListItem.* infolabels inside containers (Skin.* infolabels won't work)
The Main Idea is just a simple main menu, which every item has: label,action,background,icon(image near the text). and hopfully everything is editable.
So can you think about any way to make every list item different values? If I can't use setproperty\on focus\skin.* so how can I ?

If I wont find any solution I will need to create seperate button controls with different id, and it will be easy there to define what I want for every button... but there is a lot of work with the "ondown" "onup" and the Id's....I though list with items will be easier... hope to find a solution.
ok another problem...
If I want to show some image only if specific ID has some value,
lets says "Sub menu" only if ID has "True" in submenu value, like:

Code:
                <item id="3000">
                    <description>My Videos Button</description>
                    <label>Videos</label>
                    <onclick>noop</onclick>
                    <thumb>main/1.png</thumb>
                    <property name="submenu">True</property>
                </item>

then In the focusedlayout I create new control with this visible:
Code:
<visible>StringCompare(ListItem.Property(submenu),True)</visible>
not working...
any other way?
Try -

Code:
<visible>StringCompare(Container(ID_OF_THIS_LIST).ListItem.Property(submenu),True)</visible>

Also, this should be moved to Skin development.
Have you tried using skin shortcuts for this instead?
actually no, I will check.
(2015-04-29, 01:41)tomer953 Wrote: [ -> ]The Main Idea is just a simple main menu, which every item has: label,action,background,icon(image near the text). and hopfully everything is editable.
So can you think about any way to make every list item different values? If I can't use setproperty\on focus\skin.* so how can I ?

If I wont find any solution I will need to create seperate button controls with different id, and it will be easy there to define what I want for every button... but there is a lot of work with the "ondown" "onup" and the Id's....I though list with items will be easier... hope to find a solution.
You can set a button control under the focusedlayout. So you are able to set a button <onfocus> tag with condition for each ID.

However, +1 for script.skinshortcut. Needs some preparation for your default settings if you want to create them, but really flexible.