PDA

View Full Version : mc.GetActiveWindow()


matt.antone
May 15th, 2009, 03:49 PM
I have a function that I am calling onclick. when I call that function, the window variable comes back empty.

def getListItem():
try:
window = mc.GetActiveWindow()
list = window.GetList(200)
curListItemID = list.GetFocusedItem()
curListItems = list.GetItems()
curListItem = curListItems[curListItemID]
#aListItem = getList().getSelectedPosition()
except Exception, e:
print "error getListItem() "+str(e)
print "curListItem:: "+repr(curListItem)
return curListItem

The error I get is:

NOTICE: error getListItem() 'NoneType' object has no attribute 'Window_GetList'

This seems to be consistent with a lot of the objects in mc.py when using them in an external .py. I can get a similar error with GetActiveWindow(), GetList(), GetItem(). Anyone else having problems with the mc.py functions?

DPK
May 15th, 2009, 04:07 PM
Dumb question I know, but you are importing "mc" at the top of your python script right?

You could also try:
window = mc.GetWindow(int id)

...and force it to perhaps get the actual window you want instead of relying on it attempting to figure out the active window. I feel your pain when it comes to the mc api library. A lot of it is unsupported and I'm kind of falling back on the old xbmc functionality right now because I find the boxee api unreliable in certain cases.

matt.antone
May 15th, 2009, 04:21 PM
Yeah. I've done all that. I actually wound up writing two different functions doing the same thing. One using the mc.GetActiveWindow() and the other using xbmc.Window(). The xmbc function works everytime.

Wound up having to put our app on hold until things are more stable. And I can pull some of my new gray hairs. :eek:

idan
June 6th, 2009, 11:01 PM
what platform are you running boxee on?
please try using mc.GetWindow(14000).GetList(200) and not xbmc.
may i ask what applcation you are working on?
if you need specific help please contact me at idan at boxee d0t tv