OnUnFocus for WindowXML?
#1
Sorry ahead of time if this is a dumb question and I'm just not figuring out the right process to use.
I searched through "http://mirrors.xbmc.org/docs/python-docs" and could not find anything in there for an onUnFocus event.

Using a WindowXML window there is...def onClick(self, controlID):, def onFocus(self, controlID): and such.
How would one define onUnFocus? The reason I ask is because I'm using an alarmclock...

PHP Code:
xbmc.executebuiltin('AlarmClock(topartists,Control.Move(7010,1),00:08,silent,loop)'

on Initialization of the window to cycle through a top artists list but I want to cancel the alarm and stop cycling when the list has focus.
I tried putting ...

PHP Code:
<onfocus>CancelAlarm(topartists,true)</onfocus>
<
onunfocus>AlarmClock(topartists,Control.Move(7010,1),00:08,silent,loop)</onunfocus

in the XML for the list like you would do for a regular window but it don't work.
I can add...
PHP Code:
def onFocus(selfcontrolID):
   if 
controlID == 7010:
   
xbmc.executebuiltin'CancelAlarm(topartists,true)'

to stop the cycle when the list has focus and that works, but I can't figure out the right process to use to get it to start cycling again after the list loses focus like you could do for a regular window using onFocus and onUnfocus. So I suppose I am just asking if there is something equivalent to use for onUnFocus in a WindowXML window? Thanks.
Reply
#2
(2015-03-04, 13:22)woodside Wrote: Sorry ahead of time if this is a dumb question and I'm just not figuring out the right process to use.
I searched through "http://mirrors.xbmc.org/docs/python-docs" and could not find anything in there for an onUnFocus event.

Using a WindowXML window there is...def onClick(self, controlID):, def onFocus(self, controlID): and such.
How would one define onUnFocus? The reason I ask is because I'm using an alarmclock...

PHP Code:
xbmc.executebuiltin('AlarmClock(topartists,Control.Move(7010,1),00:08,silent,loop)'

on Initialization of the window to cycle through a top artists list but I want to cancel the alarm and stop cycling when the list has focus.
I tried putting ...

PHP Code:
<onfocus>CancelAlarm(topartists,true)</onfocus>
<
onunfocus>AlarmClock(topartists,Control.Move(7010,1),00:08,silent,loop)</onunfocus

in the XML for the list like you would do for a regular window but it don't work.
I can add...
PHP Code:
def onFocus(selfcontrolID):
   if 
controlID == 7010:
   
xbmc.executebuiltin'CancelAlarm(topartists,true)'

to stop the cycle when the list has focus and that works, but I can't figure out the right process to use to get it to start cycling again after the list loses focus like you could do for a regular window using onFocus and onUnfocus. So I suppose I am just asking if there is something equivalent to use for onUnFocus in a WindowXML window? Thanks.

I just added an alarm to restart the alarm after 1 minute inside of "def onFocus()" so it restarts the cycle after canceling, but it seems there ought to be a way to capture an onUnFocus event for a WindowXML window with an XML based control id.... no?... anybody?

PHP Code:
def onFocus(selfcontrolID):
   if 
controlID == 7010:
   
xbmc.executebuiltin'CancelAlarm(topartists,true)')            
   
xbmc.executebuiltin('AlarmClock(restarttopartists,AlarmClock(topartists,Control.Move(7010,1),00:08,silent,loop),01:00,silent)'
Reply

Logout Mark Read Team Forum Stats Members Help
OnUnFocus for WindowXML?0