The add-on i am making I would like to make a .XML window for it as well... I am looking up and checking the doc but between my noobs and some of the examples being outdated I can figure out exactly what I need.
Can someone give me a few pointers? Please.
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
Thanks I will see if I can get this working, I can the skin side fairly easy.. but this python stuff I just started and have a lot to figure out... But I can already see a major benifit because it's some thing the skin just can't do.