#! ./wafe --f
set LIBX11 /goodies/li
set LIBX11 /usr/lib/X11

set FILESEARCHPATH /usr/include/X11/%T/%N:$LIBX11/twm/%N:$LIBX11/wafe/faces/%N

set text {
<img src=audio_editor.xpm> 
Dies ist ein <a name=a href=c> anchor</a> jaja,
<p>
Dies ist noch einer <a name=b href=c>ganz sicher</a> <p>
<hr>
<FORM>
 <INPUT NAME="ixsindex" VALUE="Das ist ein Test">
</FORM>
<img src=nothing.xpm>Welcome to a PRERELEASE version of NCSA Mosaic 2.0.  
This code is
unsupported and unofficial, but comments and bug reports (to
mosaic-x@ncsa.uiuc.edu) are most appreciated nevertheless.  If you
want a stable, supported version of Mosaic, get 1.2 instead.
<p>
<img src=ghostview.xpm>This <em>README</em> details installation steps.  More complete 
information and documentation on NCSA Mosaic is available online, 
via NCSA Mosaic.
<p>
<hr>
<FORM>
 <HR>
 This is a <i>text entry</i> field;  enter search keywords:
 <INPUT NAME="isindex">
 <p>
 a few checkboxes:
 <INPUT NAME="c1" TYPE="checkbox">
 <INPUT NAME="c2" TYPE="checkbox" CHECKED="on">
 <INPUT NAME="c3" TYPE="checkbox">
 <p>
 And a PushButton: 
 <INPUT NAME="b1" VALUE="Press me" TYPE="button">
 <HR>
 Submit: <INPUT TYPE="submit">
 Reset: <INPUT TYPE="reset">
</FORM>
This README details <b>installation</b> steps.  More complete information and
documentation on NCSA Mosaic is available online, via NCSA Mosaic.
 <a name=c href=a> anchor</a>
<p>
}


mergeResources topLevel *h*background gainsboro

html h topLevel {
  width 400  
  height 300
  font "-adobe-times-medium-r-normal-*-14-*-*-*-*-*-*-*"
  anchorCallback {hTMLGotoId %w [hTMLAnchorToId %w %h]}
  submitFormCallback { formCallback "%h" "%n" "%v" }
}
sV h text $text

proc formCallback {href names values} {
  puts stderr "href=<$href>"
  puts stderr "names=<$names>"
  puts stderr "values=<$values>"
}


#action h override \
#    {<Btn1Down>:  exec(elementInfo %x %y h)}

proc elementInfo {x y widget} {
    set id [hTMLPositionToId $widget $x $y]
    hTMLIdToElement $widget $id element
    puts stderr "id = $id"
    puts stderr "anchorName = <$element(anchorName)>"
    puts stderr "anchorHRef = <$element(anchorHRef)>"
    puts stderr "edata      = <$element(edata)>"
    hTMLsetElementBg $widget $id pink
#    hTMLRetestAnchors $widget
}

realize

#addTimeOut 1500 "hTMLsetElementBg h 1 pink;sV h background yellow"
