Button click event

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
maxrs Offline
Junior Member
Posts: 1
Joined: Sep 2011
Reputation: 0
Question  Button click event Post: #1
Hi,
I'm building a little script example where a simple button should launch a click event. Following the tutorial steps I saw the function onControl is supposed to be called whenever a mouse or keyboard event is caught, but it seems not to work in the version I have installed. Nothing happens when the button is clicked. Here is my code:

http://pastebin.com/yk8nw0VT

Why didn't it work?

Thanks in advance.
find quote
giftie Offline
Skilled Python Coder
Posts: 2,036
Joined: Mar 2010
Reputation: 35
Post: #2
I think you need to change the following code:

Code:
    def onControl(self, control):
        dialog = xbmcgui.Dialog()
        dialog.ok('ex ' + action.getId(), 'ex')

to

Code:
    def onClick(self, control):
        dialog = xbmcgui.Dialog()
        dialog.ok('ex ' + control, 'ex')

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote