Code:
import xbmc
import xbmcgui
class MyDialog( xbmcgui.WindowXMLDialog ):
def __init__(self, *args, **kwargs ):
pass
def onInit (self ):
try:
self.getControl(9006).addItem( xbmcgui.\
ListItem("Added","Added Item"))
except Exception,e:
xbmc.log("Got exception in onInit %s" % e)
def onAction(self, action):
if (action.getId() == 10):
self.close()
pass
def onClick(self, controlID):
pass
def onFocus(self, controlID):
pass
if ( __name__== "__main__" ):
ui = MyDialog("Mypage.xml","")
ui.doModal()
del ui
Code:
<window type="dialog" id="732">
<defaultcontrol>9006</defaultcontrol>
<allowoverlay>yes</allowoverlay>
<coordinates>
<system>1</system>
<posx>0</posx>
<posy>0</posy>
</coordinates>
<controls>
<control type="fixedlist" id="9006">
<description>My first list container</description>
<posx>80</posx>
<posy>60</posy>
<width>600</width>
<height>300</height>
<visible>true</visible>
<onup>2</onup>
<ondown>3</ondown>
<onleft>1</onleft>
<onright>1</onright>
<orientation>vertical</orientation>
<itemlayout width="250" height="29">
<control type="image">
<posx>5</posx>
<posy>3</posy>
<width>22</width>
<height>22</height>
<info>Listitem.Icon</info>
</control>
<control type="label">
<posx>30</posx>
<posy>3</posy>
<width>430</width>
<height>22</height>
<aligny>center</aligny>
<align>left</align>
<info>ListItem.label</info>
</control>
<control type="label">
<posx>475</posx>
<posy>3</posy>
<width>300</width>
<height>22</height>
<aligny>center</aligny>
<align>right</align>
<info>ListItem.label2</info>
</control>
</itemlayout>
<focusedlayout height="29" width="250">
<control type="image">
<posx>5</posx>
<posy>3</posy>
<width>500</width>
<height>22</height>
<info></info>
</control>
<control type="image">
<posx>5</posx>
<posy>3</posy>
<width>22</width>
<height>22</height>
<info>ListItem.Icon</info>
</control>
<control type="label">
<posx>30</posx>
<posy>3</posy>
<width>430</width>
<height>22</height>
<aligny>center</aligny>
<align>left</align>
<info>ListItem.Label</info>
<visible>true</visible>
</control>
<control type="label">
<posx>475</posx>
<posy>3</posy>
<width>300</width>
<height>22</height>
<aligny>center</aligny>
<align>right</align>
<info>ListItem.Label2</info>
</control>
</focusedlayout>
<content>
<item id="1">
<label>Item1</label>
<label2>Item1-2</label2>
<icon>home_ico.png</icon>
<thumb>no_ico.png</thumb>
<onclick>ActivateWindow(Home)</onclick>
<visible>true</visible>
</item>
<item id="2">
<label>Item2</label>
<label2>Item2-2</label2>
<icon>music_ico.png</icon>
<thumb>music_ico.png</thumb>
<onclick>ActivateWindow(MyMusicLibrary)</onclick>
<visible>true</visible>
</item>
<item id="3">
<label>Item3</label>
<label2>Item3-2</label2>
<icon>audio_ico.png</icon>
<thumb>audio_ico.png</thumb>
<onclick>ActivateWindow(MyMusicLibrary)</onclick>
<visible>true</visible>
</item>
</content>
</control>
</controls>
</window>