2013-06-08, 14:57
How would i go about adding animations to lists? Is there any python functions or actions i could use or do i have to use windowsxml(i have no idea how to do this). I am not concerned about making sure my script is astheticly pleasing and will only be using the default confluence skin. It seems like this should be fairly simple to atleast be able to add some simple animation to atleast show which item in list is currently selected but after looking through the available functions i cant seem to find anything.
Code:
import xbmc, xbmcgui
#get actioncodes from https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h
ACTION_PREVIOUS_MENU = 10
class MyClass(xbmcgui.Window):
def __init__(self):
self.strActionInfo = xbmcgui.ControlLabel(250, 80, 200, 200, '', 'font14', '0xFFBBBBFF')
self.addControl(self.strActionInfo)
self.strActionInfo.setLabel('Push BACK to quit')
self.list = xbmcgui.ControlList(200, 150, 300, 400)
self.addControl(self.list)
self.list.addItem('Item 1')
self.list.addItem('Item 2')
self.list.addItem('Item 3')
self.setFocus(self.list)
def onAction(self, action):
if action == ACTION_PREVIOUS_MENU:
self.close()
def onControl(self, control):
if control == self.list:
item = self.list.getSelectedItem()
self.message('You selected : ' + item.getLabel())
def message(self, message):
dialog = xbmcgui.Dialog()
dialog.ok(" My message title", message)
mydisplay = MyClass()
mydisplay.doModal()
del mydisplay