I usually start by creating an xml with some basic controls.
- then a class from windowxml or windowxmldialog (they seem to be the same)
- then override the init, action and click methods
Code:
class cGUI(xbmcgui.WindowXML):
def __init__(self, *args, **kwargs):
xbmcgui.WindowXML.__init__(self, *args, **kwargs)
self.listing = kwargs.get("listing")
self.main_control_id = kwargs.get("id")
...
def onInit(self):
self.exit_monitor = ExitMonitor(self.close_gui)
self.gui_listbox = self.getControl(self.main_control_id)
self.gui_listbox.reset()
...
def onClick(self, controlID):
if controlID == self.main_control_id:
self.gui_listbox_SelectedPosition = self.gui_listbox.getSelectedPosition()
...
def onAction(self, action):
focused_control=self.getFocusId()
if action in [ xbmcgui.ACTION_MOVE_LEFT ]:
if focused_control==self.main_control_id:
...
finally, I call the class from my code like so:
Code:
ui = cGUI('view_461_comments.xml' , addon_path, defaultSkin='Default', defaultRes='1080i', listing=li, id=55)
ui.doModal()
del ui
this
page for skinning is very useful but there are things that only work for skins like constants, variables, param and include