Created
November 3, 2013 23:53
-
-
Save harmon/7296169 to your computer and use it in GitHub Desktop.
XBMC Sample Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xbmc, xbmcgui | |
#get actioncodes from keymap.xml | |
ACTION_PREVIOUS_MENU = 10 | |
class MyClass(xbmcgui.Window): | |
def __init__(self): | |
self.strActionInfo = xbmcgui.ControlLabel(100, 120, 200, 200, '', 'font13', '0xFFFF00FF') | |
self.addControl(self.strActionInfo) | |
self.strActionInfo.setLabel('Push BACK to quit') | |
self.button0 = xbmcgui.ControlButton(350, 500, 80, 30, "HELLO") | |
self.addControl(self.button0) | |
self.setFocus(self.button0) | |
def onAction(self, action): | |
if action == ACTION_PREVIOUS_MENU: | |
self.close() | |
def onControl(self, control): | |
if control == self.button0: | |
self.message('you pushed the button') | |
def message(self, message): | |
dialog = xbmcgui.Dialog() | |
dialog.ok(" My message title", message) | |
mydisplay = MyClass(0) | |
mydisplay.doModal() | |
del mydisplay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment