For anyone wondering, there is an <onunload></onunload> varable we can use that I never new about untill 2 mins ago, what this does is allow you to do an action on a window close
( I new there was a onload, just not a onunload, there is also a background one )
OK found a workaround
Full script here.
https://github.com/Rocky5/XBMC4Kids/tre ... s/Synopsis
Code: Select all
def onAction(self, action):
if action.getButtonCode() == 257:
if xbmc.getCondVisibility( 'Player.HasMedia' ): xbmc.executebuiltin('PlayerControl(stop)')
self.close()
def onClick(self, controlID):
if (controlID == 10 and xbmc.getCondVisibility( 'Skin.HasSetting(SynopsisMode)' ) and xbmc.getCondVisibility( 'Skin.HasSetting(Synopsis)' ) ):
self.close()
( RunXBE is run via <onclick> in a window xml )
Code: Select all
def onAction(self, action):
if action.getButtonCode() == 257:
xbmc.executebuiltin('PlayerControl(stop)')
xbmc.executebuiltin('SetFocus(50)')
self.close()
I never had this issue when I was just using a xml button focus workaround, but I moved the script over to its own thing and ran into this issue
I have also tried.
Code: Select all
def onAction(self, action):
if action == 10:
self.close()
if action == 92:
self.close()
if action.getButtonCode() == 257:
xbmc.executebuiltin('PlayerControl(stop)')
xbmc.executebuiltin('SetFocus(50)')
self.close()