title: Kodi python addon windows events
body: <p>I try to code a small <code>python</code> addon that detect the opening of a specific window then access to a custom control i added to the <code>XML</code> of the window.</p>
  
  <p>I have modified the <code>VideoOSD.xml</code> and add a control slider. Now, i need to detect <code>onWindowOpen</code> to control the slider.</p>
  
  <p>Here is where i am:</p>
  
  <pre><code>#!/usr/bin/python
  
  import xbmc
  import xbmcgui
  import subprocess
  import os.path
  import re
  import time
  
  
  class XBMCPlayer( xbmc.Player ):
  
      def __init__( self, *args ):
          pass
  
      def onPlayBackStarted( self ):
          CurrentWindowID = 0
          while True :
  
              WindowID = xbmcgui.getCurrentWindowDialogId();
  
              if WindowID != CurrentWindowID:
                  CurrentWindowID = WindowID
                  if xbmcgui.getCurrentWindowDialogId() == 12901:
  
                      w = xbmcgui.WindowDialog(CurrentWindowID) # 12901 VideoOSD.xml id
                      c = w.getControl(9000) # 9000 ID of slider control
                      c.setPercent(50.0)
  
  
  player = XBMCPlayer()
  
  
  while(not xbmc.abortRequested):
      xbmc.sleep(100)
  </code></pre>
  
  <p>And VideoOSD.xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;window&gt;
      &lt;!-- videoosd --&gt;
      &lt;defaultcontrol always="true"&gt;5&lt;/defaultcontrol&gt;
              &lt;animation type="WindowOpen"&gt;
                  &lt;effect type="zoom" start="90" end="100" center="auto" tween="back" easing="out" time="200"/&gt;
                  &lt;effect type="fade" start="0" end="100" time="200"/&gt;
              &lt;/animation&gt;
  
      &lt;controls&gt;
  
  
  
          &lt;!-- Player forwarding/rewinding --&gt;
          &lt;control type="group"&gt;
              &lt;left&gt;150&lt;/left&gt;
              &lt;top&gt;795&lt;/top&gt;
              &lt;width&gt;140&lt;/width&gt;
              &lt;height&gt;60&lt;/height&gt;
              &lt;visible&gt;!Window.IsVisible(VideoBookmarks) + !Window.IsVisible(DialogSettings.xml) + !Window.IsVisible(DialogConfirm.xml)&lt;/visible&gt;
              &lt;visible&gt;player.forwarding | player.rewinding | player.paused | player.istempo&lt;/visible&gt;
              &lt;animation type="WindowOpen" condition="!Window.IsActive(seekbar) + !Window.IsActive(fullscreeninfo)"&gt;
                  &lt;effect type="zoom" start="90" end="100" center="auto" tween="back" easing="out" time="200"/&gt;
                  &lt;effect type="fade" start="0" end="100" time="200"/&gt;
              &lt;/animation&gt;
              &lt;animation type="WindowClose" condition="!Window.IsActive(seekbar) + !Window.IsActive(fullscreeninfo)"&gt;
                  &lt;effect type="zoom" start="100" end="90" center="auto" easing="in" time="200"/&gt;
                  &lt;effect type="fade" start="100" end="0" time="200"/&gt;
              &lt;/animation&gt;
  
              &lt;!-- Background --&gt;
              &lt;control type="image"&gt;
                  &lt;width&gt;140&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;texture colordiffuse="$VAR[OverlayColor]"&gt;dialogs/Background.png&lt;/texture&gt;
              &lt;/control&gt;
  
              &lt;!-- Status --&gt;
              &lt;control type="label"&gt;
                  &lt;width&gt;140&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;font&gt;Font36&lt;/font&gt;
                  &lt;align&gt;center&lt;/align&gt;
                  &lt;label&gt;$VAR[PlayerStatus]&lt;/label&gt;
                  &lt;textcolor&gt;DialogColor2&lt;/textcolor&gt;
              &lt;/control&gt;
  
              &lt;!-- Pause --&gt;
              &lt;control type="image"&gt;
                  &lt;left&gt;40&lt;/left&gt;
                  &lt;width&gt;60&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;texture colordiffuse="DialogColor1"&gt;osd/OSDPauseNF.png&lt;/texture&gt;
                  &lt;visible&gt;player.paused&lt;/visible&gt;
              &lt;/control&gt;
  
          &lt;/control&gt;
  
          &lt;!-- Player skipping --&gt;
          &lt;control type="group"&gt;
              &lt;right&gt;150&lt;/right&gt;
              &lt;top&gt;795&lt;/top&gt;
              &lt;width&gt;140&lt;/width&gt;
              &lt;height&gt;60&lt;/height&gt;
              &lt;visible&gt;!Window.IsVisible(VideoBookmarks) + !Window.IsVisible(DialogSettings.xml)&lt;/visible&gt;
              &lt;visible&gt;[Player.DisplayAfterSeek + Integer.IsGreater(Player.ChapterCount,0)] | Integer.IsGreater(MusicPlayer.PlaylistLength,0) | !String.IsEmpty(Player.SeekStepSize)&lt;/visible&gt;
  
              &lt;!-- Background --&gt;
              &lt;control type="image"&gt;
                  &lt;width&gt;140&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;texture colordiffuse="$VAR[OverlayColor]"&gt;dialogs/Background.png&lt;/texture&gt;
              &lt;/control&gt;
  
              &lt;!-- Status --&gt;
              &lt;control type="label"&gt;
                  &lt;width&gt;140&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;font&gt;Font27&lt;/font&gt;
                  &lt;align&gt;center&lt;/align&gt;
                  &lt;label&gt;[B]$INFO[Player.Chapter,(,/]$INFO[Player.ChapterCount,,)][/B][B]$INFO[MusicPlayer.PlaylistPosition,(,/]$INFO[MusicPlayer.PlaylistLength,,)][/B]&lt;/label&gt;
                  &lt;textcolor&gt;DialogColor2&lt;/textcolor&gt;
                  &lt;visible&gt;!Window.IsVisible(visualisation) + String.IsEmpty(Player.SeekStepSize)&lt;/visible&gt;
              &lt;/control&gt;
  
              &lt;!-- Status --&gt;
              &lt;control type="label"&gt;
                  &lt;width&gt;140&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;font&gt;Font27&lt;/font&gt;
                  &lt;align&gt;center&lt;/align&gt;
                  &lt;label&gt;[B]$INFO[MusicPlayer.PlaylistPosition,(,/]$INFO[MusicPlayer.PlaylistLength,,)][/B]&lt;/label&gt;
                  &lt;textcolor&gt;DialogColor2&lt;/textcolor&gt;
                  &lt;visible&gt;Window.IsVisible(visualisation) + String.IsEmpty(Player.SeekStepSize)&lt;/visible&gt;
              &lt;/control&gt;
  
              &lt;!-- Status --&gt;
              &lt;control type="label"&gt;
                  &lt;width&gt;140&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;font&gt;Font27&lt;/font&gt;
                  &lt;align&gt;center&lt;/align&gt;
                  &lt;visible&gt;!String.IsEmpty(Player.SeekStepSize)&lt;/visible&gt;
                  &lt;label&gt;$INFO[Player.SeekStepSize]&lt;/label&gt;
                  &lt;textcolor&gt;DialogColor2&lt;/textcolor&gt;
              &lt;/control&gt;
  
          &lt;/control&gt;
  
          &lt;!-- Progress --&gt;
          &lt;control type="group"&gt;
              &lt;visible&gt;!Window.IsVisible(DialogSettings.xml)&lt;/visible&gt;
              &lt;left&gt;150&lt;/left&gt;
              &lt;top&gt;870&lt;/top&gt;
              &lt;width&gt;1620&lt;/width&gt;
              &lt;height&gt;60&lt;/height&gt;
  
              &lt;animation type="WindowOpen" condition="!Window.IsActive(seekbar) + !Window.IsActive(fullscreeninfo)"&gt;
                  &lt;effect type="zoom" start="90" end="100" center="auto" tween="back" easing="out" time="200"/&gt;
                  &lt;effect type="fade" start="0" end="100" time="200"/&gt;
              &lt;/animation&gt;
              &lt;animation type="WindowClose" condition="!Window.IsActive(seekbar) + !Window.IsActive(fullscreeninfo)"&gt;
                  &lt;effect type="zoom" start="100" end="90" center="auto" easing="in" time="200"/&gt;
                  &lt;effect type="fade" start="100" end="0" time="200"/&gt;
              &lt;/animation&gt;
  
              &lt;!-- Background --&gt;
              &lt;control type="image"&gt;
                  &lt;width&gt;1620&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;texture colordiffuse="$VAR[OverlayColor]"&gt;dialogs/Background.png&lt;/texture&gt;
              &lt;/control&gt;
  
              &lt;!--  Current position/Time remaining --&gt;
              &lt;control type="label"&gt;
                  &lt;left&gt;20&lt;/left&gt;
                  &lt;width&gt;260&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;font&gt;Font27&lt;/font&gt;
                  &lt;textcolor&gt;DialogColor2&lt;/textcolor&gt;
                  &lt;label&gt;$INFO[Player.Time] / $INFO[Player.Duration]&lt;/label&gt;
              &lt;/control&gt;
  
              &lt;control type="slider" id="9000"&gt;
                  &lt;left&gt;280&lt;/left&gt;
                  &lt;top&gt;20&lt;/top&gt;
                  &lt;width&gt;920&lt;/width&gt;
                  &lt;height&gt;20&lt;/height&gt;
                  &lt;texturesliderbar border="10,0,10,0"&gt;osd/OSDSliderBack.png&lt;/texturesliderbar&gt;
                  &lt;textureslidernib border="10,0,10,0"&gt;osd/OSDSliderNib.png&lt;/textureslidernib&gt;
                  &lt;textureslidernibfocus border="10,0,10,0"&gt;osd/OSDSliderNib.png&lt;/textureslidernibfocus&gt;
              &lt;/control&gt; 
  
              &lt;!-- Seek slider 
              &lt;control type="slider"&gt;
                  &lt;left&gt;280&lt;/left&gt;
                  &lt;top&gt;20&lt;/top&gt;
                  &lt;width&gt;920&lt;/width&gt;
                  &lt;height&gt;20&lt;/height&gt;
                  &lt;texturesliderbar /&gt;
                  &lt;textureslidernib /&gt;
                  &lt;textureslidernibfocus /&gt;
                  &lt;action&gt;seek&lt;/action&gt;
              &lt;/control&gt;
              --&gt;
  
              &lt;!--  Progress bar --&gt;
              &lt;control type="progress"&gt;
                  &lt;left&gt;280&lt;/left&gt;
                  &lt;top&gt;20&lt;/top&gt;
                  &lt;width&gt;920&lt;/width&gt;
                  &lt;height&gt;20&lt;/height&gt;
                  &lt;info&gt;Player.Progress&lt;/info&gt;
                  &lt;texturebg border="2" colordiffuse="DialogColor2"&gt;osd/OSDProgressBack.png&lt;/texturebg&gt;
                  &lt;lefttexture&gt;-&lt;/lefttexture&gt;
                  &lt;midtexture border="2" colordiffuse="DialogColor1"&gt;osd/OSDProgressBar.png&lt;/midtexture&gt;
                  &lt;righttexture&gt;-&lt;/righttexture&gt;
                  &lt;overlaytexture&gt;-&lt;/overlaytexture&gt;
              &lt;/control&gt;
  
              &lt;!--  Cache bar --&gt;
              &lt;control type="progress"&gt;
                  &lt;left&gt;280&lt;/left&gt;
                  &lt;top&gt;20&lt;/top&gt;
                  &lt;width&gt;920&lt;/width&gt;
                  &lt;height&gt;20&lt;/height&gt;
                  &lt;info&gt;Player.ProgressCache&lt;/info&gt;
                  &lt;texturebg colordiffuse="DialogColor2" border="2"&gt;osd/OSDProgressBack.png&lt;/texturebg&gt;
                  &lt;lefttexture&gt;-&lt;/lefttexture&gt;
                  &lt;midtexture colordiffuse="OSDCache" border="2"&gt;osd/OSDProgressBar.png&lt;/midtexture&gt;
                  &lt;righttexture&gt;-&lt;/righttexture&gt;
                  &lt;overlaytexture&gt;-&lt;/overlaytexture&gt;
              &lt;/control&gt;
  
              &lt;!-- Current Time/End Time --&gt;
              &lt;control type="label"&gt;
                  &lt;left&gt;1001&lt;/left&gt;
                  &lt;width&gt;600&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;align&gt;right&lt;/align&gt;
                  &lt;font&gt;Font27&lt;/font&gt;
                  &lt;textcolor&gt;DialogColor2&lt;/textcolor&gt;
                  &lt;label&gt;$INFO[System.Time,$LOCALIZE[142] , / ]$INFO[Player.FinishTime,$LOCALIZE[19081] ]&lt;/label&gt;
              &lt;/control&gt;
  
          &lt;/control&gt;
  
          &lt;control type="group"&gt;
              &lt;left&gt;150&lt;/left&gt;
              &lt;top&gt;945&lt;/top&gt;
              &lt;width&gt;1620&lt;/width&gt;
              &lt;height&gt;60&lt;/height&gt;
              &lt;visible&gt;!Window.IsVisible(VideoBookmarks) + !Window.IsVisible(DialogSettings.xml)&lt;/visible&gt;
              &lt;animation type="WindowOpen" condition="!Window.IsActive(seekbar) + !Window.IsActive(fullscreeninfo)"&gt;
                  &lt;effect type="zoom" start="90" end="100" center="auto" tween="back" easing="out" time="200"/&gt;
                  &lt;effect type="fade" start="0" end="100" time="200"/&gt;
              &lt;/animation&gt;
              &lt;animation type="WindowClose" condition="!Window.IsActive(seekbar) + !Window.IsActive(fullscreeninfo)"&gt;
                  &lt;effect type="zoom" start="100" end="90" center="auto" easing="in" time="200"/&gt;
                  &lt;effect type="fade" start="100" end="0" time="200"/&gt;
              &lt;/animation&gt;
  
              &lt;!-- Background --&gt;
              &lt;control type="image"&gt;
                  &lt;width&gt;1620&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;texture colordiffuse="$VAR[OverlayColor]"&gt;dialogs/Background.png&lt;/texture&gt;
              &lt;/control&gt;
  
              &lt;!-- Controls --&gt;
              &lt;control type="grouplist"&gt;
                  &lt;width&gt;540&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;itemgap&gt;0&lt;/itemgap&gt;
                  &lt;onleft&gt;20&lt;/onleft&gt;
                  &lt;onright&gt;12&lt;/onright&gt;
                  &lt;onup&gt;30&lt;/onup&gt;
                  &lt;ondown&gt;30&lt;/ondown&gt;
                  &lt;orientation&gt;horizontal&lt;/orientation&gt;
  
                  &lt;!-- Spacer --&gt;
                  &lt;control type="image" id="40"&gt;
                      &lt;left&gt;0&lt;/left&gt;
                      &lt;top&gt;0&lt;/top&gt;
                      &lt;width&gt;7&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texture&gt;transparent.png&lt;/texture&gt;
                  &lt;/control&gt;
  
                  &lt;!-- Skip Back --&gt;
                  &lt;control type="button" id="1"&gt;
                      &lt;width&gt;9&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;2&lt;/onleft&gt;
                      &lt;onright&gt;4&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickBackwardEnd.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDTrickBackwardEnd.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;PlayerControl(Previous)&lt;/onclick&gt;
                      &lt;visible&gt;!VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- Rewind --&gt;
                  &lt;control type="togglebutton" id="2"&gt;
                      &lt;width&gt;18&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;8&lt;/onleft&gt;
                      &lt;onright&gt;10&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickBackward.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDTrickBackward.png&lt;/texturenofocus&gt;
                      &lt;alttexturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickBackward.png&lt;/alttexturefocus&gt;
                      &lt;alttexturenofocus colordiffuse="DialogColor1"&gt;osd/OSDTrickBackward.png&lt;/alttexturenofocus&gt;
                      &lt;usealttexture&gt;Control.HasFocus(1)&lt;/usealttexture&gt;
                      &lt;onclick&gt;PlayerControl(Rewind)&lt;/onclick&gt;
                      &lt;visible&gt;Player.SeekEnabled&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- Tempo Down --&gt;
                  &lt;control type="togglebutton" id="3"&gt;
                      &lt;width&gt;18&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;8&lt;/onleft&gt;
                      &lt;onright&gt;10&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickBackward.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDTrickBackward.png&lt;/texturenofocus&gt;
                      &lt;alttexturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickBackward.png&lt;/alttexturefocus&gt;
                      &lt;alttexturenofocus colordiffuse="DialogColor1"&gt;osd/OSDTrickBackward.png&lt;/alttexturenofocus&gt;
                      &lt;usealttexture&gt;Control.HasFocus(1) | Control.HasFocus(2)&lt;/usealttexture&gt;
                      &lt;onclick&gt;PlayerControl(TempoDown)&lt;/onclick&gt;
                      &lt;visible&gt;Player.SeekEnabled&lt;/visible&gt;
                      &lt;enable&gt;Player.TempoEnabled&lt;/enable&gt;
                  &lt;/control&gt;
  
                  &lt;!-- Spacer --&gt;
                  &lt;control type="image" id="41"&gt;
                      &lt;left&gt;0&lt;/left&gt;
                      &lt;top&gt;0&lt;/top&gt;
                      &lt;width&gt;7&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texture&gt;transparent.png&lt;/texture&gt;
                  &lt;/control&gt;
  
                  &lt;!-- Up --&gt;
                  &lt;control type="button" id="4"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;4&lt;/onleft&gt;
                      &lt;onright&gt;6&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDUpNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDUpNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;PlayerControl(Previous)&lt;/onclick&gt;
                      &lt;visible&gt;VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
  
                  &lt;!-- Play/Pause --&gt;
                  &lt;include condition="Player.PauseEnabled"&gt;OSDPlayStopButtons&lt;/include&gt;
                  &lt;!-- Stop --&gt;
                  &lt;include condition="!Player.PauseEnabled"&gt;OSDStopButton&lt;/include&gt;
  
                  &lt;!-- Down --&gt;
                  &lt;control type="button" id="7"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;5&lt;/onleft&gt;
                      &lt;onright&gt;7&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDDownNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDDownNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;PlayerControl(Next)&lt;/onclick&gt;
                      &lt;visible&gt;VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
  
                  &lt;!-- Spacer --&gt;
                  &lt;control type="image" id="42"&gt;
                      &lt;left&gt;0&lt;/left&gt;
                      &lt;top&gt;0&lt;/top&gt;
                      &lt;width&gt;7&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texture&gt;transparent.png&lt;/texture&gt;
                  &lt;/control&gt;
  
                  &lt;!-- Tempo Up --&gt;
                  &lt;control type="togglebutton" id="8"&gt;
                      &lt;width&gt;18&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;8&lt;/onleft&gt;
                      &lt;onright&gt;10&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickForward.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDTrickForward.png&lt;/texturenofocus&gt;
                      &lt;alttexturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickForward.png&lt;/alttexturefocus&gt;
                      &lt;alttexturenofocus colordiffuse="DialogColor1"&gt;osd/OSDTrickForward.png&lt;/alttexturenofocus&gt;
                      &lt;usealttexture&gt;Control.HasFocus(9) | Control.HasFocus(10)&lt;/usealttexture&gt;
                      &lt;onclick&gt;PlayerControl(TempoUp)&lt;/onclick&gt;
                      &lt;visible&gt;Player.SeekEnabled&lt;/visible&gt;
                      &lt;enable&gt;Player.TempoEnabled&lt;/enable&gt;
                  &lt;/control&gt;
                  &lt;!-- Fast Forward --&gt;
                  &lt;control type="togglebutton" id="9"&gt;
                      &lt;width&gt;18&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;8&lt;/onleft&gt;
                      &lt;onright&gt;10&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickForward.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDTrickForward.png&lt;/texturenofocus&gt;
                      &lt;alttexturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickForward.png&lt;/alttexturefocus&gt;
                      &lt;alttexturenofocus colordiffuse="DialogColor1"&gt;osd/OSDTrickForward.png&lt;/alttexturenofocus&gt;
                      &lt;usealttexture&gt;Control.HasFocus(10)&lt;/usealttexture&gt;
                      &lt;onclick&gt;PlayerControl(Forward)&lt;/onclick&gt;
                      &lt;visible&gt;Player.SeekEnabled&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- Next --&gt;
                  &lt;control type="button" id="10"&gt;
                      &lt;width&gt;9&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;7&lt;/onleft&gt;
                      &lt;onright&gt;9&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDTrickForwardEnd.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDTrickForwardEnd.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;PlayerControl(Next)&lt;/onclick&gt;
                      &lt;visible&gt;!VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
  
                  &lt;!-- Spacer --&gt;
                  &lt;control type="image" id="43"&gt;
                      &lt;left&gt;0&lt;/left&gt;
                      &lt;top&gt;0&lt;/top&gt;
                      &lt;width&gt;7&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texture&gt;transparent.png&lt;/texture&gt;
                  &lt;/control&gt;
  
                  &lt;!-- Record --&gt;
                  &lt;control type="togglebutton" id="11"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;onleft&gt;8&lt;/onleft&gt;
                      &lt;onright&gt;10&lt;/onright&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDRecordOffNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDRecordOffNF.png&lt;/texturenofocus&gt;
                      &lt;alttexturefocus colordiffuse="DialogColor1"&gt;osd/OSDRecordOnNF.png&lt;/alttexturefocus&gt;
                      &lt;alttexturenofocus colordiffuse="DialogColor2"&gt;osd/OSDRecordOnNF.png&lt;/alttexturenofocus&gt;
                      &lt;usealttexture&gt;Player.Recording&lt;/usealttexture&gt;
                      &lt;onclick&gt;PlayerControl(Record)&lt;/onclick&gt;
                      &lt;visible&gt;Player.CanRecord&lt;/visible&gt;
                  &lt;/control&gt;
  
              &lt;/control&gt;
  
              &lt;!-- Options --&gt;
              &lt;control type="grouplist" id="30"&gt;
                  &lt;right&gt;0&lt;/right&gt;
                  &lt;width&gt;360&lt;/width&gt;
                  &lt;height&gt;60&lt;/height&gt;
                  &lt;align&gt;right&lt;/align&gt;
                  &lt;itemgap&gt;0&lt;/itemgap&gt;
                  &lt;onleft&gt;11&lt;/onleft&gt;
                  &lt;onright&gt;1&lt;/onright&gt;
                  &lt;onup&gt;5&lt;/onup&gt;
                  &lt;ondown&gt;5&lt;/ondown&gt;
                  &lt;orientation&gt;horizontal&lt;/orientation&gt;
  
                  &lt;!-- 3D mode --&gt;
                  &lt;control type="button" id="12"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSD3DNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSD3DNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;StereoMode&lt;/onclick&gt;
                      &lt;visible&gt;VideoPlayer.IsStereoscopic&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- Video Settings --&gt;
                  &lt;control type="button" id="13"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDVideoNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDVideoNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;ActivateWindow(123)&lt;/onclick&gt;
                  &lt;/control&gt;
                  &lt;!-- Audio Settings --&gt;
                  &lt;control type="button" id="14"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDAudioNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDAudioNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;ActivateWindow(124)&lt;/onclick&gt;
                  &lt;/control&gt;
                  &lt;!-- Bookmarks --&gt;
                  &lt;control type="button" id="15"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDBookmarksNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDBookmarksNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;ActivateWindow(125)&lt;/onclick&gt;
                      &lt;visible&gt;!VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- Subtitles --&gt;
                  &lt;control type="button" id="16"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDSubtitlesNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDSubtitlesNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;Close&lt;/onclick&gt;
                      &lt;onclick&gt;ActivateWindow(SubtitleSearch)&lt;/onclick&gt;
                      &lt;visible&gt;!VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- Channels --&gt;
                  &lt;control type="button" id="17"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDChannelNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDChannelNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;ActivateWindow(PVROSDChannels)&lt;/onclick&gt;
                      &lt;visible&gt;VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- Channel EPG --&gt;
                  &lt;control type="button" id="18"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDEPGNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDEPGNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;ActivateWindow(PVROSDGuide)&lt;/onclick&gt;
                      &lt;visible&gt;VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- Teletext --&gt;
                  &lt;control type="button" id="19"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDTextNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDTextNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;ActivateWindow(Teletext)&lt;/onclick&gt;
                      &lt;visible&gt;VideoPlayer.Content(LiveTV)&lt;/visible&gt;
                  &lt;/control&gt;
                  &lt;!-- DVD menu --&gt;
                  &lt;control type="button" id="20"&gt;
                      &lt;width&gt;60&lt;/width&gt;
                      &lt;height&gt;60&lt;/height&gt;
                      &lt;texturefocus colordiffuse="DialogColor1"&gt;osd/OSDDvdNF.png&lt;/texturefocus&gt;
                      &lt;texturenofocus colordiffuse="DialogColor2"&gt;osd/OSDDvdNF.png&lt;/texturenofocus&gt;
                      &lt;onclick&gt;PlayerControl(ShowVideoMenu)&lt;/onclick&gt;
                      &lt;visible&gt;VideoPlayer.HasMenu&lt;/visible&gt;
                  &lt;/control&gt;
  
              &lt;/control&gt;
  
          &lt;/control&gt;
  
      &lt;/controls&gt;
  
  &lt;/window&gt;
  </code></pre>
  
  <p>My log file says the control 9000 doesn't exist</p>