Kodi Community Forum

Full Version: Help with onclick custom skin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm making a skinned addon and running into a issue. I made a button on my main.xml and trying to open a new custom xml file. but getting ERROR: Unable to locate window with id 1101. Check skin files

This is what i have on the button
<onclick>ActivateWindow(1101)</onclick>

and on the custom.xml file i have this
<window id="1101">

not sure why i can't open the new window! Keep in mind that this is a fully skinned addon! i can get it work if i do
a python script

if self.getFocusId() == 1101

But i would like it to be with in the xml file rather than py
Hope this makes sense Smile
I believe that window ID is in a range reserved for skins
i even change the id number too 90000 and still no go
Try changing the name of your custom.xml file to custom_custom.xml. If I remember correctly, any non-standard skin file should begin with 'custom_'

Setting the ID in the 5000 range should do the trick.
All Addons should name their skin files (if they use any) with a prefix "script-" at the start, then the Addon name and last the name of the window. If you are not follow that naming pattern, ιt is absolutely certain that your window will be the same with some other Addon's window and it will be impossible for a skinner to skin it.

Cheers
Nessus
(2015-02-04, 17:37)Mikewave Wrote: [ -> ]i would like it to be with in the xml file rather than py
try: <onclick>ActivateWindow(custom.xml)</onclick>

if it doesn't work then there's a big fat change it's just not possible
and you should let your addon open the windows.
So the <onclick>ActivateWindow(script-movie.xml)</onclick> doesn't work in the skinned addon that i'm making but now im running into another issue when trying to open the xml in the py file. So i have this as the code in the main xml file.

Code:
<control type="list" id="8999">
                <description>Main List</description>
                <left>50</left>
                <top>25</top>
                <width>4000</width>
                <height>4000</height>
                <ondown>5555</ondown>
                <onup>4444</onup>
                <visible>true</visible>
                <pagecontrol>-</pagecontrol>
                <scrolltime>300</scrolltime>
                <focusposition>1</focusposition>
                <movement>1</movement>
                <orientation>horizontal</orientation>
                <itemlayout height="360" width="255">
                    <control type="image">
                        <left>50</left>
                        <top>175</top>
                        <width>250</width>
                        <height>250</height>
                        <texture colordiffuse="FF969096">$INFO[ListItem.Icon]</texture>
                    </control>
                    <control type="label">
                        <left>50</left>
                        <top>430</top>
                        <width>260</width>
                        <font>font10_title</font>
                        <textcolor>white</textcolor>
                        <shadowcolor>ff000000</shadowcolor>
                        <align>center</align>
                        <label colordiffuse="FF969096">$INFO[ListItem.Label]</label>
                    </control>
                </itemlayout>
                <focusedlayout height="360" width="255">
                    <!--<control type="image">
                        <left>50</left>
                        <top>175</top>
                        <width>260</width>
                        <height>350</height>
                        <texture>shine.png</texture>
                    </control>-->
                    <control type="image">
                        <left>50</left>
                        <top>175</top>
                        <width>250</width>
                        <height>250</height>
                        <animation effect="zoom" end="135" center="200,360" time="200">Focus</animation>
                        <texture>$INFO[ListItem.Icon]</texture>
                    </control>
                    <control type="label">
                        <left>50</left>
                        <top>430</top>
                        <width>260</width>
                        <font>font10_title</font>
                        <textcolor>white</textcolor>
                        <shadowcolor>ff000000</shadowcolor>
                        <align>center</align>
                        <animation effect="zoom" end="135" center="200,360" time="200">Focus</animation>
                        <label>$INFO[ListItem.Label]</label>
                    </control>
                </focusedlayout>
                <content>
                    <item id="9000">
                        <label>Movie Indexer</label>
                        <icon>movie.png</icon>
                        <thumb>movie2.png</thumb>
                        <!--<onclick>ActivateWindow(script-movie.xml)</onclick>-->
                        <onclick>-</onclick>
                        <visible>true</visible>
                    </item>
                    <item id="9001">
                        <label>tv shows Indexer</label>
                        <icon>tvshow.png</icon>
                        <thumb>tvshow2.png</thumb>
                        <onclick>-</onclick>
                    </item>
                    <item id="9002">
                        <label>IMDB Indexer</label>
                        <icon>IMDB.png</icon>
                        <thumb>IMDB2.png</thumb>
                        <onclick>-</onclick>
                        <visible>true</visible>
                    </item>
                    <item id="9003">
                        <label>Trakt Indexer</label>
                        <icon>trakt2.png</icon>
                        <thumb>trakt.png</thumb>
                        <onclick>-</onclick>
                    </item>
                </content>
            </control>

This is what i have in the py file to call when item id is clicked.

Code:
def onAction(self,action):
                if action == ACTION_CONTEXT_MENU:
                        self.doMenu()
                elif action == ACTION_SELECT_ITEM:
                        if self.getFocusId() == 9000:
                                w = Main_Menu("script-movie.xml" , __addon__.getAddonInfo('path'), "Default")
                                w.doModal()
                                del w

For some reason i can't get it too work in a fixed list container. Any help would be great thanks.