windowxml?
#1
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.
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#2
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
Reply
#3
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.
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply

Logout Mark Read Team Forum Stats Members Help
windowxml?0