2014-02-24, 14:32
Here's the gist...
When you click the button in the top-left of the screen you get the exception
Why is this happening? I'm sure I've seen this sort of sub-classing of controls done before. Am I doing something obviously wrong?
I'm using a recent Gotham build on Linux and Windows.
Here is an add-on to test it: script.control.zip
PHP Code:
class Button(xbmcgui.ControlButton):
def afunc(self):
return "Success!!"
class MyDialog(xbmcgui.WindowDialog):
def __init__(self):
self.button = Button(0, 0, 100, 100, "Click Me")
self.addControl(self.button)
self.setFocus(self.button)
def onControl(self, control):
if control == self.button:
msg = control.afunc()
dialog = MyDialog()
dialog.doModal()
When you click the button in the top-left of the screen you get the exception
Code:
'xbmcgui.ControlButton' object has no attribute 'afunc'
Why is this happening? I'm sure I've seen this sort of sub-classing of controls done before. Am I doing something obviously wrong?
I'm using a recent Gotham build on Linux and Windows.
Here is an add-on to test it: script.control.zip