[pyxpcom] python and xulrunner - how to use
by Vanush Vee other posts by this author
May 21 2009 4:11AM messages near this date
view in the new Beta List Site
[pyxpcom] Python errors/warnings when quitting during page load
|
Re: [pyxpcom] python and xulrunner - how to use
Hi
I want to use XULRunner with python because it seems like a really good way
to make my scripts fancy without bothering with large UI frameworks,
however, i'm having some trouble getting it to work. Before, I was unable to
get any method of an element working (such as menulist), the console would
say 'has no attribute appendItem' but then Todd Whiteman suggested that I
have to QueryInterface. Okay, but then I want to use the getRowCount method
of listbox , I get a no attribute error no matter what interface I'm
querying
<button label="getRowCount" oncommand="getRowCount()" />
and then in my script
def getRowCount():
nlist = document.getElementById('myList')
nlist.QueryInterface(components.interfaces.nsIListBoxObject)
nlist.getRowCount()
I just get the error
WARNING:xpcom:Python DOM script error
Traceback (most recent call last):
File "C:\pyxpcom_gui_app\xulrunner\pylib\nsdom\context.py", line 478, in
CallEventHandler
return handler(*args)
File "chrome://pyxpcom_gui_app/content/pyxpcom_gui_app.xul", line 1, in
oncommand
File "chrome://pyxpcom_gui_app/content/pyxpcom_gui_app.xul", line 42, in
getRowCount
File "C:\pyxpcom_gui_app\xulrunner\pylib\xpcom\client\__init__.py", line
336, in QueryInterface
raw_iface = self._comobj_.QueryInterface(iid, 0)
<class 'xpcom.Exception'> : -2147467262 (-2147467262)
Any ideas as to what is wrong/what I should do. Thx.
Thread:
Vanush Vee
Todd Whiteman
Vanush Vee
Rasjid Wilcox
Vanush Vee
|