Window dialog

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ScottishJason Offline
Junior Member
Posts: 1
Joined: Apr 2013
Reputation: 0
Post: #1
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
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!
(This post was last modified: 2013-04-07 15:19 by ScottishJason.)
find quote
Bstrdsmkr Offline
Fan
Posts: 651
Joined: Oct 2010
Reputation: 12
Post: #2
Need to know what error message is produced in the logs
find quote
hippojay Offline
Fan
Posts: 301
Joined: Mar 2008
Reputation: 13
Location: Sheffield, UK
Post: #3
(2013-04-07 15:16)ScottishJason Wrote:  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

Can't help with the code, but for the RPi I tend to find that it is slow at setting up the python interpreter, which in turn makes it slow to run a script.

Add-on:PleXBMC - Play Plex media through XBMC
PleXBMC Helper - Integrate Official/Unoffical Plex remote control apps into PleXBMC
PleXBMC Repository - install and manage all PleXBMC addons
Quartz3 PleXBMC - Integrate PleXBMC into home menus
find quote