Kodi Community Forum

Full Version: Button on startup.xml
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

i have got a question. I would like to make a button on my startup.xml. But it doenst work..... Do i have to make same changes in other files?
This is my startup file. Or do i have to start home first?
<window>
<defaultcontrol always="true">5</defaultcontrol>
<allowoverlay>no</allowoverlay>
<controls>

<control>
<description>startup-top image</description>
<type>image</type>
<posx>0</posx>
<posy>0</posy>
<width>2000</width>
<height>2000</height>
<texture>weiss.png</texture>
<animation effect="fade" start="0" end="100" time="300">windowopen</animation>
</control>

<control>
<description>startup-bottom image</description>
<type>image</type>
<posx>300</posx>
<posy>20</posy>
<width>600</width>
<height>500</height>
<texture>logo.png</texture>
<animation effect="fade" start="0" end="100" time="300">windowopen</animation>
</control>

<control>
<description>xbmc build info's</description>
<type>label</type>
<posx>328</posx>
<posy>590</posy>
<textcolor>ff000000</textcolor>>
<font>font12</font>
<label>!!!!! WOOOOOOOOOOOOOOOOOOOOOOOHHHHH !!!!![CR] Sogar Zeilenumbruch geschafft</label>
<animation effect="fade" time="300">windowopen</animation>
<animation effect="fade" time="200">windowclose</animation>
</control>

<control type="fadelabel" id="1">
<description>My First fadelabel</description>
<posx>80</posx>
<posy>60</posy>
<width>250</width>
<visible>true</visible>
<scroll>false</scroll>
<scrollout>true</scrollout>
<pauseatend>500</pauseatend>
<label>presents by Donnnnnny</label>
<font>font14</font>
<textcolor>ff000000</textcolor>
<textoffsetx>20</textoffsetx>
</control>
<control type="button" id="1">
<description>My first button control</description>
<posx>80</posx>
<posy>100</posy>
<width>30</width>
<height>30</height>
<visible>true</visible>
<colordiffuse>FFFFFFFF</colordiffuse>
<texturefocus>-</texturefocus>
<texturenofocus>300px-Button_Icon_Black.png</texturenofocus>
<label>29</label>
<font>font12</font>
<textcolor>ff000000</textcolor>
<disabledcolor>AARRGGBB</disabledcolor>
<align></align>
<aligny></aligny>
<textoffsetx></textoffsetx>
<textoffsety></textoffsety>
<pulseonselect></pulseonselect>
<onclick></onclick>
<onfocus>executebuiltin('XBMC.RunScript(C:\Spiele\ok.py)')</onfocus>
<onup>2</onup>
<ondown>3</ondown>
<onleft>1</onleft>
<onright>1</onright>
</control>
</controls>
</window>

Please Help
mind telling us just what doesn't exactly work?

- you're using <defaultcontrol always="true">5</defaultcontrol>
but i don't see any control with id="5"

- the whole <type> thing is deprecated, use <control type=""> instead.

- Startup.xml will always be run before Home.xml
ronie Wrote:mind telling us just what doesn't exactly work?

- you're using <defaultcontrol always="true">5</defaultcontrol>
but i don't see any control with id="5"

- the whole <type> thing is deprecated, use <control type=""> instead.

- Startup.xml will always be run before Home.xml

All of this is working great. Only the Button doens´t start anything when i press it.

<control type="fadelabel" id="1">
<description>My First fadelabel</description>
<posx>80</posx>
<posy>60</posy>
<width>250</width>
<visible>true</visible>
<scroll>false</scroll>
<scrollout>true</scrollout>
<pauseatend>500</pauseatend>
<label>presents by Donnnnnny</label>
<font>font14</font>
<textcolor>ff000000</textcolor>
<textoffsetx>20</textoffsetx>
</control>
<control type="button" id="1">
<description>My first button control</description>
<posx>80</posx>
<posy>100</posy>
<width>30</width>
<height>30</height>
<visible>true</visible>
<colordiffuse>FFFFFFFF</colordiffuse>
<texturefocus>-</texturefocus>
<texturenofocus>300px-Button_Icon_Black.png</texturenofocus>
<label>29</label>
<font>font12</font>
<textcolor>ff000000</textcolor>
<disabledcolor>AARRGGBB</disabledcolor>
<align></align>
<aligny></aligny>
<textoffsetx></textoffsetx>
<textoffsety></textoffsety>
<pulseonselect></pulseonselect>
<onclick></onclick>
<onfocus>executebuiltin('XBMC.RunScript(C:\Spiele\ ok.py)')</onfocus>
<onup>2</onup>
<ondown>3</ondown>
<onleft>1</onleft>
<onright>1</onright>
</control>
</controls>
</window>

This Part
give this a shot:
<onclick>RunScript(C:\Spiele\ok.py)</onclick>

in case that don't work, check your Debug Log for errors.