However, I set myself on another trail after sending a reply
to another thread, which involved yet another extension, ffidl.
Using ffidl I have been able to solve my problem, and I
would like to present my solution here. It is based on the info
Alexander put in his patch file.
Here is a little test script (note: you will need OpTcl and Ffidl
in the lib subdirectory):
-----------------------------------------------------
load lib/optcl.dll
load lib/ffidl05.dll
ffidl::callout dll_SetFocus {int} int [ffidl::symbol user32.dll SetFocus]
proc GrabFocus {args} {dll_SetFocus [winfo id .]}
canvas .main
optcl::new -window .main.h "file:///[pwd]/index.htm"
.main create window 0 0 -anchor nw -window .main.h
entry .entry1
entry .entry2
pack .main .entry1 .entry2
bind . <Button> +GrabFocus
-----------------------------------------------------
You should also create the index.htm file, with e.g. the following content:
-----------------------------------------------------
<html>
<head>
</head>
<body>
<input type="text">
</body>
</html>
-----------------------------------------------------
If you now type something in the HTML input box, and next click in either
one of the entries, the selected entry will get the keyboard focus.
To see the original problem, just comment the last line in the script, and try
again.
Maybe this will be of help to someone!
Rob Hegt