2013-09-29, 10:04
Hi. How to force a script that pressing ControlImage perform the action (display DialogBox).
Code:
ACTION_PREVIOUS_MENU = 10
ACTION_SELECT_ITEM = 7
ACTION_MOUSE_LEFT_CLICK = 100
class MyClass(xbmcgui.Window):
def __init__(self):
self.strActionInfo = xbmcgui.ControlLabel(250, 80, 200, 200, '', 'font14', '0xFFBBBBFF')
self.addControl(self.strActionInfo)
self.strActionInfo.setLabel('Push BACK to quit')
self.image = xbmcgui.ControlImage(500,500,100,100, path + '//avatar100x100.jpg')
self.image2 = xbmcgui.ControlImage(610,500,100,100, path + '//avatar100x100.jpg')
self.addControl(self.image)
self.addControl(self.image2)
def onAction(self, action):
if action == ACTION_PREVIOUS_MENU:
self.close()
def onControl(self, control):
if control == self.image:
xbmcgui.Dialog().ok('Selected', 'image 1')
if control == self.image2:
xbmcgui.Dialog().ok('Selected', 'image 2')
mydisplay = MyClass()
mydisplay.doModal()
del mydisplay