Get index of clicked ControlButton
#1
Hello!
I have a simple question. I have an add-on that displays multiple ControlButtons:
Code:
self.buttons = []
for i in data
            name = i['full_name']
            self.buttons.append(xbmcgui.ControlButton(....)
            self.addControl(self.buttons[-1])
Then i listen for clicked buttons in def onControl(self, action) method. I wonder how can i simply get the index of clicked button or is this not possible?

Thank you!
Reply
#2
i've never used onControl() myself, but according to the docs it returns the control.
so this might work?
Code:
self.buttons.index(action)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
Get index of clicked ControlButton0