Advertisement
Guest User

Untitled

a guest
Jun 29th, 2023
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. import xbmcgui
  2. import xbmcaddon
  3. import xbmc
  4.  
  5. #region Create LandingPageWindow, Initialize, and Focus
  6. class LandingPageWindow(xbmcgui.WindowXML):
  7. def __init__(self, *args, **kwargs):
  8. xbmcgui.WindowXML.__init__(self, *args, **kwargs)
  9.  
  10. def onInit(self):
  11. xbmc.log("LandingPageWindow - onInit")
  12. label_control = self.getControl(1001) # Get the label control by its ID
  13. self.setFocus(label_control) # Set the focus to the label control
  14. #endregion
  15.  
  16. #region ON CLICK
  17. def onClick(self, controlId):
  18. if controlId == 1001: # ID of the AllSportsButton control
  19. xbmc.executebuiltin("ActivateWindow(13001)") # Open the "All Sports" window
  20. #endregion
  21.  
  22. #region Launch Landing Page and close it
  23. cwd = xbmcaddon.Addon().getAddonInfo('path')
  24.  
  25. def landingrun():
  26. print("Running landing page")
  27. # Create an instance of the landing page window
  28. window = LandingPageWindow('landingpage.xml', cwd, 'default', '1080i')
  29. window.doModal()
  30.  
  31. # Clean up when the landing page is closed
  32. del window
  33. #endregion
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement