2013-04-07, 15:16
Hi guys,
( running Raspbmc - Frodo on a Model B(512meg) Raspberry Pi )
I am fairly new to XBMC and python scripting in general but I am slowly learning and getting there. I have been testing some sample scripts to get dialog's and notifications appearing. The sample notification code worked but the dialog box code returns me back a script error.
The code is
I've been searching for days on possible reasons for this script error without success, can any of you XBMC experts point me in the right direction. The end goal is to get some returned API information displayed in a window (with the ability to back out of it)
Another question is.... why does it sometimes take 10 seconds or more to launch a tiny python script from the file manager. Is this due to my slow hardware or some kind of setting/bug?
I noticed that sometimes if I move up or down on the menu it kicks the script in without having to wait so long, sometimes this is not the case though. Pretty confusing
anyway, thanks guys!
( running Raspbmc - Frodo on a Model B(512meg) Raspberry Pi )
I am fairly new to XBMC and python scripting in general but I am slowly learning and getting there. I have been testing some sample scripts to get dialog's and notifications appearing. The sample notification code worked but the dialog box code returns me back a script error.
The code is
Code:
import xbmc, xbmcgui
#get actioncodes from https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h
ACTION_PREVIOUS_MENU = 10
ACTION_SELECT_ITEM = 7
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')
def onAction(self, action):
if action == ACTION_PREVIOUS_MENU:
self.message('goodbye')
self.close()
if action == ACTION_SELECT_ITEM:
self.message('you pushed A')
def message(self, message):
dialog = xbmcgui.Dialog()
dialog.ok(" My message title", message)
mydisplay = MyClass()
mydisplay .doModal()
del mydisplay
I've been searching for days on possible reasons for this script error without success, can any of you XBMC experts point me in the right direction. The end goal is to get some returned API information displayed in a window (with the ability to back out of it)
Another question is.... why does it sometimes take 10 seconds or more to launch a tiny python script from the file manager. Is this due to my slow hardware or some kind of setting/bug?
I noticed that sometimes if I move up or down on the menu it kicks the script in without having to wait so long, sometimes this is not the case though. Pretty confusing
anyway, thanks guys!