Package: python-xpcom
Version: 1.8.0.10-3
Severity: normal

--- Please enter the report below this line. ---
$ find xultest
xultest/
xultest/application.ini
xultest/chrome
xultest/chrome/chrome.manifest
xultest/chrome/xultest
xultest/chrome/xultest/xultest.xul
xultest/components
xultest/components/myXulTest.xpt
xultest/components/myXulTest.py
xultest/components/myXulTest.idl
xultest/defaults
xultest/defaults/preferences
xultest/defaults/preferences/prefs.js

>>>>>>>>> xultest.xul :
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window id="mainWindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; orient="vertical" title="window1">
  <textbox id="TheTextBox" flex="1" readonly="true" value="Hello XUL" />
  <script type="application/x-javascript">
var thing = Components.classes['@heaven.is/myXulTest;1'].createInstance(Components.interfaces.myXulTest);
//    var item = document.getElementById("TheTextBox");
    thing.setDocument(document);
  </script>
</window>

>>>>>>>> myXulTest.idl :
#include "nsIDOMDocument.idl"
[scriptable, uuid(ad7f063b-40ee-46ae-87b4-6ed6b56695a0)]
interface myXulTest : nsISupports
{
  void setDocument( in nsIDOMDocument document );
};

>>>>>>> myXulTest.py :
from xpcom import components

class myXulTest:
    _com_interfaces_ = components.interfaces.myXulTest
    _reg_clsid_ = "{ad7f063b-40ee-46ae-87b4-6ed6b56695a0}"
    _reg_contractid_ = "@heaven.is/myXulTest;1"

    def setDocument(self,document) :
pyelement = document.getElementById('TheTextBox').QueryInterface(components.interfaces.nsIDOMXULTextBoxElement)
        pyelement.value = 'Hello pyelement'

With the "var item .." line in the javascript code commented out, I get an exception on the QueryInterface call in the python code. If the "var item ..." line is not commented, I have no problems, everything works.

xultest$ xulrunner application.ini
** Unhandled exception calling 'int8 setDocument(in nsISomething);'
Traceback (most recent call last):
File "/var/lib/python-support/python2.4/xpcom/server/policy.py", line 272, in _CallMethod_
    return 0, func(*params)
File "/home/dofri/code/tmp/xultest/components/myXulTest.py", line 9, in setDocument pyelement = document.getElementById('TheTextBox').QueryInterface(components.interfaces.nsIDOMXULTextBoxElement) File "/var/lib/python-support/python2.4/xpcom/client/__init__.py", line 300, in QueryInterface
    ret = self._comobj_.QueryInterface(iid, 0)
Exception: 0x-7fffbffe (NS_ERROR_NO_INTERFACE)
** Returning nsresult of NS_ERROR_FAILURE

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.20-1-686

Debian Release: 4.0
  500 unstable        mirrors.dotsrc.org
  500 unstable        debian-multimedia.org
  500 kernel-dists-trunk kernel-archive.buildserver.net

--- Package information. ---
Depends                  (Version) | Installed
==================================-+-================
libc6                 (>= 2.3.6-6) | 2.3.6.ds1-13
libnspr4-0d          (>= 1.8.0.10) | 1.8.0.10-3
libstdc++6           (>= 4.1.1-12) | 4.1.1-21
libxul0d           (>= 1.8.0.1-12) | 1.8.0.10-3
python2.4              (>= 2.3.90) | 2.4.4-2
python                    (<< 2.5) | 2.4.4-2
python-support          (>= 0.3.4) | 0.6.2
python                    (>= 2.4) | 2.4.4-2



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to