getCurrentWindowID()
#1
Quote:import xbmc,xbmcgui

action_menu = 10 ##remote: menu
action_select_item = 7

class test(xbmcgui.window):
def (self):
self.addcontrol(xbmcgui.controlimage(0,0,720,480, "q:\\scripts\\image_background.png"))

def onaction(self,action):
if action == action_menu:
self.close()
if action == action_select_item:
print "here" # <- no problem printing
x = xbmcgui.getcurrentwindowid()
print str(x) # <- doesn't print that

mydisplay = test()
mydisplay.domodal()
del mydisplay

when i run the above code, i get a red bg screen. when i press 'a' i would expect two lines to be printed. instead, the log only shows 'here' as being printed. am i using the xbmcgui.getcurrentwindowid() function incorrectly?

thanks!
Reply
#2
just to rule out the print command doing something funny with the strings, try adding a:

print "there"

before the:

print str(x)

as far as i can tell from the code, the xbmc side of this function seems to be doing what it's requested (returns the id of the current window).

cheers,
jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
i apologize for not doing that earlier; usually i'm smart enough to go step-by-step. yet, when i add:

Quote:print "there"
between lines as you instructed, "there" does not print.

to clarify that getcurrentwindowid() was erroring, i added:

Quote:try:
x = xbmcgui.getcurrentwindowid()
except:
print "error"
print exception
and "error" and "exceptions.exception" get printed.

now that i for sure know that xbmcgui.getcurrentwindowid() is the problem, how am i going about using it wrong, or is it simply xbmc's *fault*. i googled and tried these forums, but have been unable to locate any relevent information.

thanks for the help!

(i did find a cool xbmc app though, but i can't get it to work: xbmc control desktop)
Reply
#4
what does your logfile say about that problem?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
getCurrentWindowID()0