Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xbmcgui
- import xbmcaddon
- import xbmc
- #region Create LandingPageWindow, Initialize, and Focus
- class LandingPageWindow(xbmcgui.WindowXML):
- def __init__(self, *args, **kwargs):
- xbmcgui.WindowXML.__init__(self, *args, **kwargs)
- def onInit(self):
- xbmc.log("LandingPageWindow - onInit")
- label_control = self.getControl(1001) # Get the label control by its ID
- self.setFocus(label_control) # Set the focus to the label control
- #endregion
- #region ON CLICK
- def onClick(self, controlId):
- if controlId == 1001: # ID of the AllSportsButton control
- xbmc.executebuiltin("ActivateWindow(13001)") # Open the "All Sports" window
- #endregion
- #region Launch Landing Page and close it
- cwd = xbmcaddon.Addon().getAddonInfo('path')
- def landingrun():
- print("Running landing page")
- # Create an instance of the landing page window
- window = LandingPageWindow('landingpage.xml', cwd, 'default', '1080i')
- window.doModal()
- # Clean up when the landing page is closed
- del window
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement