stk/Lib/help.stk

44 lines
1.3 KiB
Plaintext
Raw Normal View History

1996-09-27 06:29:02 -04:00
;;;;
;;;; Help management
;;;;
1999-09-05 07:16:41 -04:00
;;;; Copyright <20> 1993-1999 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
1996-09-27 06:29:02 -04:00
;;;;
1999-09-05 07:16:41 -04:00
;;;; Permission to use, copy, modify, distribute,and license this
;;;; software and its documentation for any purpose is hereby granted,
;;;; provided that existing copyright notices are retained in all
;;;; copies and that this notice is included verbatim in any
;;;; distributions. No written agreement, license, or royalty fee is
;;;; required for any of the authorized uses.
;;;; This software is provided ``AS IS'' without express or implied
;;;; warranty.
1996-09-27 06:29:02 -04:00
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 14-Sep-1993 13:30
1999-09-05 07:16:41 -04:00
;;;; Last file update: 3-Sep-1999 19:52 (eg)
1996-09-27 06:29:02 -04:00
;;;;
1998-04-10 06:59:06 -04:00
(require "www-browser")
1996-09-27 06:29:02 -04:00
1998-06-09 07:07:40 -04:00
(select-module STk)
1996-09-27 06:29:02 -04:00
(define (STk:show-help-file name)
;; Show the file (after having found the Help directory)
(let loop ((l *help-path*))
(if (null? l)
(error "Cannot find help file ~S" name)
1998-04-10 06:59:06 -04:00
(let* ((f (string-append (car l) "/" name))
1996-09-27 06:29:02 -04:00
(fd (open-file f "r")))
1998-04-10 06:59:06 -04:00
(catch (close-port fd))
1996-09-27 06:29:02 -04:00
(if fd
1998-06-09 07:07:40 -04:00
(www:browser :url f)
1996-09-27 06:29:02 -04:00
(loop (cdr l)))))))
(define (help . arg)
1999-09-05 07:16:41 -04:00
(let ((browser (if (null? arg)
(STk:show-help-file "STk-hlp.html")
(STk:show-help-file (format #f "~A.n.html" (car arg))))))
(wm 'deiconify (slot-ref browser 'parent))
#f))
1998-06-09 07:07:40 -04:00
1998-04-10 06:59:06 -04:00
(provide "help")