#!/bin/sh
# comment \
exec wish "$0" "$@"
#
set prompt(newwindow) 1
#
proc open_browser {} {
  global prompt
  if {$prompt(newwindow)} {
    exec  netscape -remote "openBrowser()" &
    exit
  } else {
    exec  killall -q -KILL netscape
    exec  rm -f ~/.netscape/lock
    exec  netscape &
    exit
  }
}

#
set nsbg "#c0c0c0"
wm title . "Netscape: Question"
. configure -bg $nsbg
set nsfont "-adobe-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1"
set lbl "Netscape seems to be running."

frame .frm1 -bg $nsbg -relief raised -bd 1
 frame .frm1.spc -bg $nsbg -bd 6
  label  .frm1.spc.lb1 -bg $nsbg -textvariable lbl -font $nsfont
  pack .frm1.spc.lb1 
 pack .frm1.spc

frame .frm2 -bg $nsbg -relief raised -bd 1

 frame .frm2.spc1 -bg $nsbg -bd 8
  radiobutton .frm2.spc1.pc1 -font $nsfont -bg $nsbg -highlightbackground $nsbg -activebackground $nsbg \
    -text "Open a new Navigator window." -variable prompt(newwindow) \
    -value 1 -anchor w
  pack .frm2.spc1.pc1 -side left

 frame .frm2.scp2 -bg $nsbg -bd 8
  radiobutton .frm2.scp2.pc2 -font $nsfont -bg $nsbg -highlightbackground $nsbg -activebackground $nsbg \
    -text "Kill all Netscape and restart." -variable prompt(newwindow) \
    -value 0 -anchor w
  pack .frm2.scp2.pc2 -side left
 pack .frm2.spc1 .frm2.scp2 -side top -fill x

frame .frm3 -bg $nsbg -relief raised -bd 1
 frame .frm3.spc -bg $nsbg -bd 8
  button .frm3.spc.bt1 -bg $nsbg -highlightbackground $nsbg \
    -activebackground $nsbg -font $nsfont \
    -text "OK" \
    -command { open_browser }
  button .frm3.spc.bt2 -bg $nsbg -highlightbackground $nsbg \
    -activebackground $nsbg -font $nsfont \
    -text "Cancel" \
    -command exit
  pack .frm3.spc.bt2 -side right
  pack .frm3.spc.bt1 -side left
 pack .frm3.spc -fill x

pack .frm1 .frm2 .frm3 -side top -fill both
