generate the buttons id in python - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: generate the buttons id in python (/showthread.php?tid=225422) |
generate the buttons id in python - Pr0ph3cyTiger - 2015-04-27 Hi guys I have got some questions, is that possible to generate the buttons id in python and I wonder how I could generate the buttons id? I want to generate 250 buttons for per row on 500 rows. I just need this because I'm making my own tv guide. If that is possible, I would love to know how! RE: generate the buttons id in python - Roman_V_M - 2015-04-28 Not sure what you need, but a simple list of button objects can do the trick. Something like that: Code: buttons = [] Then a specific button can be accessed by its digital index, e.g.: Code: buttons[index].setLabel('New label') RE: generate the buttons id in python - Pr0ph3cyTiger - 2015-04-28 @Roman_V_M: Thank you very much for this. What I want to achieve is I want to use the same buttons id when I readd the buttons after I removed them using in python. I tried to use the grouplist control but it will slow down and freeze the screen. So how I can use the same buttons id when I readd them? If the simple list of button object can do the trick, I wonder how I can readd the list of buttons in the same list of buttons when I call on two different threads? e.g: Code: class ProgramControls(object): I use All_Channels to add the list of buttons when I hit on the enter button of the keyboard to call on All_Channels function so I can add the list of program buttons in the array. When I hit on the down arrow button, it will call the GoDown function to add the list of buttons. I want to readd the list of buttons in the same array as the All_Channels buttons. How I can do that? RE: generate the buttons id in python - Pr0ph3cyTiger - 2015-04-30 @Roman_V_M Do you know how I can readd the list of buttons with same id when I removed them? |