2019-12-10, 15:45
why this not working on matrix
Quote:self.addControl(self.img)on versions like v18, v17 works pretty well but on matrix neither "OK" , neither "Cancel" works
self.chk = [0]*9
self.chkbutton = [0]*9
self.chkstate = [False]*9
for obj in self.chk:
self.addControl(obj)
obj.setVisible(False)
for obj in self.chkbutton:
self.addControl(obj)
self.cancelbutton = xbmcgui.ControlButton(250 + 260 - 70, 620, 140, 50, 'Cancel', alignment = 2)
self.okbutton = xbmcgui.ControlButton(250 + 520 - 50, 620, 100, 50, 'OK', alignment = 2)
self.addControl(self.okbutton)
self.addControl(self.cancelbutton)
def onControl(self, control):
if control == self.okbutton:
if self.anythingChecked():
self.close()
elif control == self.cancelbutton:
self.cancelled = True
self.close()
try:
if 'xbmcgui.ControlButton' in repr(type(control)):
index = control.getLabel()
if index.isnumeric():
self.chkstate[int(index)-1] = not self.chkstate[int(index)-1]
self.chk[int(index)-1].setVisible(self.chkstate[int(index)-1])
except: pass