PDA

View Full Version : scrolling button controls


troutbum
2008-10-21, 20:07
I have created some custom buttons that I am using for a script I am working on...but the number of buttons varies, is there a way to add a scrollbar control to a bunch of buttons?

jmarshall
2008-10-22, 00:05
If you use a grouplist to place the buttons in, sure. You'd be using windowxml to achieve this.

troutbum
2008-10-25, 00:02
thanks for the response, I will say that I am new to scripting for XBMC, I have looked through the documentation but may have missed this so bear with me.

This is a dynamic list created based on the output of a SQL query. The query returns all TV show names and paths, I am then hashing the path, retrieving the tbn and creating a button for each. I am overlaying these buttons on the tbn for each tv series.

I can make this work just fine using xbmcgui.window, but if there are too may buttons they are off screen and I take from your comments there is not a grouplist available in xbmcgui.window, only windowxml.


As I have been looking at window.xml, I can see how I could add a known amount of button controls to a controllist, but how would I do this in the above scenario? Is there a way to create/modify the XML file at run time?

I am sure there is an obvious solution, but I am struggling to find it in any of the docs?

any help is appreciated.

thanks

Nuka1195
2008-10-25, 01:03
you could use a list control and make the images for the items look like buttons.

but

i can't test now, but jmarshall did make a change where any container control can be acted on, so try windowxml, give the control an id (not 50-59) and try self.getControl(id).addItem(listitem). it may work :)