Error in pythonic InternetExplorer hta application

Christof Pastors christof_n at pastors.de
Thu Jan 11 05:33:35 EST 2001


Hi,

I saw the nice concept of hta applications mentioned in

 http://deja.com/=gh/article/%3C92v27e02jia@news2.newsguy.com%3E

and rewrote the Microsoft example mentioned there

http://msdn.microsoft.com/workshop/author/hta/overview/htaoverview.asp

in Python. But it doesnt work!

I get a NameError exception because the name "TheAddress" is not found.
In which object can I find "TheAddress"???
I guessed "window.TheAddress" and "document.TheAddress" without success.

Here is my code:

<html>
<head>
  <TITLE>HTML Application Example</TITLE>
  <HTA:APPLICATION ID="HTAEx"
    APPLICATIONNAME="HTAEx"
    ICON="e.ico"
    WINDOWSTATE="normal">
</head>
<body>
<span id=AddressBar style="overflow: none">
<span id=AddText>Address</span>
<input type=text value="http://www.python.org" id=TheAddress style="width:
expression(document.body.clientWidth - AddText.offsetWidth -
AddGo.offsetWidth - 45)">
<input type=button value="Go" id=AddGo onclick="navigate()"><br>
<span>
<br>
<iframe src="http://www.python.org" id=TheFrame style="width: 100%; height:
85%"></iframe>

<script language=Python>
def navigate():
   print "Hello, " + TheAddress.value
def clickShortcut():
   if window.event.keyCode == 13:
      navigate()
TheAddress.onkeypress = clickShortcut
</script>
</body>
</html>






More information about the Python-list mailing list