Kodi Community Forum
Alpha xbmcgui.WindowDialog not working on Matrix - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: Alpha xbmcgui.WindowDialog not working on Matrix (/showthread.php?tid=349970)



xbmcgui.WindowDialog not working on Matrix - fihc - 2019-12-10

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


RE: xbmcgui.WindowDialog not working on Matrix - DarrenHill - 2019-12-10

Thread moved to Kodi development


RE: xbmcgui.WindowDialog not working on Matrix - fihc - 2019-12-12

(2019-12-10, 15:51)DarrenHill Wrote: Thread moved to Kodi development
This is bug not something to develop


RE: xbmcgui.WindowDialog not working on Matrix - burekas - 2021-09-29

I have a similar problem too.

The conditions inside the "onControl" function doesn't work.
Why?


RE: xbmcgui.WindowDialog not working on Matrix - Roman_V_M - 2021-09-29

IIRC dicrect comparison for Control instances is indeed broken. You should compare controls' IDs using getId() method.


RE: xbmcgui.WindowDialog not working on Matrix - burekas - 2021-09-29

(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?


RE: xbmcgui.WindowDialog not working on Matrix - burekas - 2021-09-29

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():
            ....