2005-05-02, 05:25
hello i just recently got into python because i want to make scripts /programs for xbox. thank god for python i was stuck thinking c++ was only answer.
anyway i've been reading the tutorial and it just doesn't seem to work correctly:
this doesn't do anything when i run it on my xbox.. when i run it in cmd.exe it says:
file "f:\python24\display.py", line 9, in ?
if action == action_select_item:
nameerror: name 'action' is not defined
please help me!
anyway i've been reading the tutorial and it just doesn't seem to work correctly:
Quote:import xbmc, xbmcgui
#get actioncodes from keymap.xml
action_previous_menu = 10
action_select_item = 7
class myclass(xbmcgui.window):
def onaction(self, action):
if action == action_previous_menu:
self.close()
if action == action_select_item:
self.straction = xbmcgui.controllabel(300, 200, 200, 200, "", "font14", "0xff00ff00")
self.addcontrol(self.straction)
self.straction.setlabel("hello nicky!")
mydisplay = myclass()
mydisplay.domodal()
del mydisplay
this doesn't do anything when i run it on my xbox.. when i run it in cmd.exe it says:
file "f:\python24\display.py", line 9, in ?
if action == action_select_item:
nameerror: name 'action' is not defined
please help me!