;;;;
;;;; Help management
;;;;
;;;; Copyright (C) 1993,1994,1995 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;; 
;;;; Permission to use, copy, and/or distribute this software and its
;;;; documentation for any purpose and without fee is hereby granted, provided
;;;; that both the above copyright notice and this permission notice appear in
;;;; all copies and derived works.  Fees for distribution or use of this
;;;; software or derived works may only be charged with express written
;;;; permission of the copyright holder.  
;;;; This software is provided ``as is'' without express or implied warranty.
;;;;
;;;;           Author: Erick Gallesio [eg@unice.fr]
;;;;    Creation date: 14-Sep-1993 13:30
;;;; Last file update: 27-Apr-1994 09:36
;;;;

(provide "help")
(require "editor")

(define (stk:make-help STF)
  (catch (destroy ".stk-help"))
  (toplevel ".stk-help")
  (wm 'title .stk-help "STk help")
  (wm 'maxsize .stk-help 800 800)
  
  ; Create a dismiss button
  (button ".stk-help.b" :text "Dismiss" :command '(destroy .stk-help))

  ; Create a text widget with the content of list
  (frame ".stk-help.f" :relief "sunken" :bd 2)
  (pack [scrollbar ".stk-help.f.sb"
		   :orient "vertical" :command ".stk-help.f.t 'yview"]
	:side "left" :fill "y")
  (pack [text ".stk-help.f.t" 
	      :relief "raised" :bd 2 :padx 12 :pady 12
	      :height 18 :wrap "word" :yscroll ".stk-help.f.sb 'set"]
	:fill "both" :expand #t)


  (stk:set-STF .stk-help.f.t STF)
  ; Set the text read only
  (tk-set! .stk-help.f.t :state "disabled")
  
  (pack .stk-help.b :side "bottom" :fill "x" :padx 4 :pady 2)
  (pack .stk-help.f :fill "both" :expand #t :padx 4 :pady 2))
