Alpha xbmcgui.WindowDialog not working on Matrix
#1
why this not working on matrix
Quote:self.addControl(self.img)

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
on versions like v18, v17 works pretty well but on matrix neither "OK" , neither "Cancel" works
Reply
#2
Thread moved to Kodi development
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
(2019-12-10, 15:51)DarrenHill Wrote: Thread moved to Kodi development
This is bug not something to develop
Reply
#4
I have a similar problem too.

The conditions inside the "onControl" function doesn't work.
Why?
Reply
#5
IIRC dicrect comparison for Control instances is indeed broken. You should compare controls' IDs using getId() method.
Reply
#6
(2021-09-29, 10:26)Roman_V_M Wrote: IIRC dicrect comparison for Control instances is indeed broken. You should compare controls' IDs using getId() method.

Thanks.
May you have any kind of an example so I can take a look on how to implement this?
Reply
#7
Nevermind, I understood how to fix this:
Code:
    def onControl(self, control):
        _controlID = control.getId()
        if _controlID == self.pause.getId():
           ....
        elif _controlID == self.play.getId():
            ....
Reply

Logout Mark Read Team Forum Stats Members Help
xbmcgui.WindowDialog not working on Matrix0