[pyxpcom] Inline Python in XUL application for calling XUL browser goBack() method
by Ryan Sturmer other posts by this author
Aug 9 2007 11:21PM messages near this date
view in the new Beta List Site
Re: [pyxpcom] Current Mozilla build with pyxul extensions
|
Re: [pyxpcom] Inline Python in XUL application for calling XUL browsergoBack() method
Allrighty! Still wrapping my head around this one. I hesitate to
post "stupid" questions, but recently there's been talk of needing
more people looking at this stuff... so stupid questions are better
than none I guess.
I've got a simple XUL application, with a python script-type, segment
of code shown below:
<hbox flex="1">
<vbox flex="1">
<groupbox flex="1" aspect="1.33333">
<caption label="Electrowetting Surface" />
<browser id="surface" type="content"
src="chrome://main/content/index.xhtml" flex="1" />
</groupbox>
<splitter collapse="none" />
<vbox flex="1">
<textbox id="python-output" readonly="true" flex="1" />
<textbox id="python-input" />
</vbox>
</vbox>
<vbox width="200">
<tabbox flex="1">
<tabs>
<tab label="Settings" />
<tab label="Chip Info" />
</tabs>
<tabpanels flex="1">
<tabpanel name="Settings">
<button label="Back"
oncommand="document.getElementById('surface').goBack()" />
</tabpanel>
</tabpanels>
</tabbox>
</vbox>
</hbox>
A click on the button returns the following message to my error console:
WARNING:xpcom:Python DOM script error
Traceback (most recent call last):
File "C:\mozilla-src-vc71\mozilla\obj-i686-pc-mingw32\dist\bin\python\nsdom\context.py",
line 478, in CallEventHandler
return handler(*args)
File "chrome://main/content/main.xul", line 1, in oncommand
File "C:\mozilla-src-vc71\mozilla\obj-i686-pc-mingw32\dist\bin\python\nsdom\context.py",
line 144, in __getattr__
return Component.__getattr__(self, attr)
File "C:\mozilla-src-vc71\mozilla\obj-i686-pc-mingw32\dist\bin\python\xpcom\client\__init_
_.py",
line 384, in __getattr__
raise AttributeError, "XPCOM component '%s' has no attribute '%s'"
% (self._object_name_, attr)
<type 'exceptions.AttributeError'> : XPCOM component '<unknown>' has no
attribute 'goBack'
Where did I go wrong? Should this have worked? If it should have,
why not, and if not, how can I fix it so it should have?
-R
--
"Time is an illusion. Lunchtime, doubly so."
Ryan Sturmer
ryansturmer@[...].com
http://www.gogglemarks.net/
_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Ryan Sturmer
Mark Hammond
Ryan Sturmer
Mark Hammond
Ryan Sturmer
|