home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / TCL / BLT / BLT1.7L1 / BLT1 / blt-1.7 / applications / kosherdill / Help / HyperHelp.add < prev    next >
Encoding:
Text File  |  1993-11-23  |  2.7 KB  |  91 lines

  1.  
  2.  Adding HyperHelp To Your Own Tcl/Tk Application
  3.  ---------------------------------------------------------------
  4.  
  5.  To add HyperHelp facilities to your own Tcl/Tk application:
  6.  
  7.    1) Obtain the BLT toolkit from harbor.ecn.purdue.edu.
  8.       Add it to your favorite "wish" executable, or use
  9.       the "blt_wish" provided with it.  The BLT toolkit
  10.       supplies extra widgets and commands needed by the
  11.       HyperHelp facility.
  12.  
  13.    2) Copy the "hyperhelp.tcl" source file to your Tcl
  14.       application code directory.  Source it directly into
  15.       your application, or create a "tclIndex" file and
  16.       set up the search path for auto loading.
  17.  
  18.    3) Modify your application to include a call to
  19.       "hyperhelp_init":
  20.  
  21.         USAGE:
  22.           hyperhelp_init <application-name> <help-dir>
  23.  
  24.         EXAMPLE:
  25.           hyperhelp_init "My Application" ./Help
  26.  
  27.    4) Add hooks into your application to invoke the HyperHelp
  28.       viewer:
  29.  
  30.         USAGE:
  31.           hyperhelp_file <file> ?<line>?  <== displays file
  32.           hyperhelp_mesg <mesg> ?<line>?  <== displays message
  33.  
  34.         EXAMPLE:
  35.           button .help -text "Help" \
  36.               -command "hyperhelp_file Intro"
  37.  
  38.  
  39.  Writing HyperHelp Documentation
  40.  ---------------------------------------------------------------
  41.  
  42.  HyperHelp documentation is kept as a series of ASCII files
  43.  in a "help" directory that is registered via the "hyperhelp_init"
  44.  command.  The files are displayed exactly as they are written,
  45.  with the exception of hyperlinks.
  46.  
  47.  Hyperlinks are added by embedding a statement surrounded by
  48.  special "\%\%" characters.  Statements within the "\%\%"
  49.  characters are interpreted as Tcl commands; white space around
  50.  the commands is ignored.  A Hyperlink is defined using a
  51.  command with the following form:
  52.  
  53.      hyperhelp_link <link-name> <jump-file> ?<jump-marker>?
  54.  
  55.  where <link-name> is the text displayed on the hyperlink
  56.  button, <jump-file> is the name of another file in the help
  57.  directory, and the optional <jump-marker> specifies a
  58.  particular entry point for the help file.
  59.  
  60.  For example, following is an excerpt from the file that brought
  61.  you to this point in the documentation:
  62.  
  63.      HyperHelp facilities are easily \%\%
  64.     hyperhelp_link integrated HyperHelp.add
  65.     \%\%
  66.     into any Tcl/Tk
  67.      application.
  68.  
  69.  Markers are defined in a similar manner, using the "hyperhelp_mark"
  70.  command:
  71.  
  72.      hyperhelp_mark <marker-name>
  73.  
  74.  For example:
  75.  
  76.      More information is available in \%\%
  77.     hyperhelp_link "Section A" some.file Section-A
  78.     \%\%
  79.     of this document.
  80.  
  81.      ...
  82.  
  83.     \%\%
  84.     hyperhelp_mark Section-A
  85.     \%\%
  86.     This is the start of Section A...
  87.  
  88.  When the user traverses the link marked "Section A", the HyperHelp
  89.  facility will jump immediately to the sentence "This is the start
  90.  of Section A."
  91.