listen to onaction of a window i didn't create?
#1
Hi
i want in a service script listen to action events (specifically to keyboard events onscreen keyboard and real) of a Window i get with
window = xbmcgui.Window(xbmcgui.getCurrentWindowDialogId())
i tried to override the function onAction on the instance with
window.onAction = types.MethodType(myonAction, window)
but failed with Error Contents: 'xbmcgui.Window' object attribute 'onAction' is read-only
(Im not so fit with python, 15years with java)
I also checked the monitor class but couldnt really find something.
Is there a way to hook for a listener somewhere for actions?
I figured i could extend window override onaction and assign all contents of the original to my new instance and call all methods of the original in my version . Hide the original show my version but that seems to be a bit overblown to just add a listener.
I could also continuesly read the text of the editbox control in a loop but that feels quite like a bad thing to do.
Any advice?
Thanks
Benni
Reply
#2
(2018-01-09, 22:32)Takezo36 Wrote: window.onAction = types.MethodType(myonAction, window)
but failed with Error Contents: 'xbmcgui.Window' object attribute 'onAction' is read-only
(Im not so fit with python, 15years with java)

I cannot consider myself a Python guru but this is a rather strange construction. Huh types are used for type checks and not for something else.  And I'm pretty sure that Java has a concept of class inheritance and overriding virtual methods. onAction method is meant to be overriden in a child class. Anyway, it seems that you cannot catch events in a window you haven't created (or rather haven't started its event loop with doModal() ).
Reply
#3
hi
thanks for the reply. yeah its quite a strange construct got it from this stackoverflow thread https://stackoverflow.com/questions/3947...ance-level
Reply

Logout Mark Read Team Forum Stats Members Help
listen to onaction of a window i didn't create?0