home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / TCL / ITCL / _ITCL.TAR / usr / lib / itcl / doc / README < prev   
Encoding:
Text File  |  1994-08-21  |  7.9 KB  |  215 lines

  1. IMPORTANT NOTE:  This package has been customized for Linux to support
  2. the desired directory structure and the automatic generation of shared
  3. libraries.  See the README.linux file for details.  If you do not plan
  4. on compiling this package under Linux, you should get an unmodified
  5. version from your favorite Tcl/Tk archive site.
  6.  
  7. ------------------------------------------------------------------------
  8.                       [incr Tcl] - version 1.5
  9. ------------------------------------------------------------------------
  10.   This version will only work with Tcl version 7.0 and beyond.
  11.   At this point, it has only been tested with versions 7.0-7.3.
  12.  
  13.   Please send comments or suggestions to michael.mclennan@att.com.
  14. ========================================================================
  15.               Copyright (c) 1993   AT&T Bell Laboratories
  16. ========================================================================
  17. Permission to use, copy, modify, and distribute this software and its
  18. documentation for any purpose and without fee is hereby granted,
  19. provided that the above copyright notice appear in all copies and that
  20. both that the copyright notice and warranty disclaimer appear in
  21. supporting documentation, and that the names of AT&T Bell Laboratories
  22. any of their entities not be used in advertising or publicity
  23. pertaining to distribution of the software without specific, written
  24. prior permission.
  25.  
  26. AT&T disclaims all warranties with regard to this software, including
  27. all implied warranties of merchantability and fitness.  In no event
  28. shall AT&T be liable for any special, indirect or consequential
  29. damages or any damages whatsoever resulting from loss of use, data or
  30. profits, whether in an action of contract, negligence or other
  31. tortuous action, arising out of or in connection with the use or
  32. performance of this software.
  33. ========================================================================
  34.  
  35.  
  36. Implementation Notes:
  37.  
  38. [incr Tcl] adds object-oriented programming facilities to Tcl.  It
  39. was NOT designed as yet another whiz-bang object-oriented programming
  40. language; indeed, it is patterned somewhat after C++.  It was designed
  41. to support more structured programming in Tcl.  Scripts that grow
  42. beyond a few thousand lines become extremely difficult to maintain.
  43. [incr Tcl] attacks this problem in the same way that any object-
  44. oriented programming language would, by providing mechanisms for
  45. data encapsulation behind well-defined interfaces.  In many cases,
  46. ideas for new widgets or objects can be prototyped using [incr Tcl],
  47. and if necessary, the code can be translated to C for more efficient
  48. execution; the public (Tcl) interface, however, could remain unchanged.
  49.  
  50.  
  51. READ THE INTRO:
  52.  
  53. A tutorial explanation of [incr Tcl] is presented in the PostScipt
  54. file "Intro.ps".  This tutorial describes a family of "Toaster"
  55. classes that illustrate many of the features available in this package.
  56. Source code for the example classes is provided in "demos/toasters".
  57.  
  58.  
  59. INSTALLATION AND TESTING:
  60.  
  61.   1)  Obtain this distribution from harbor.ecn.purdue.edu:
  62.  
  63.         ftp harbor.ecn.purdue.edu
  64.         cd pub/tcl/extensions
  65.         binary
  66.         get itcl-1.5.tar.gz
  67.         quit
  68.  
  69.   2)  Uncompress and untar the distribution:
  70.  
  71.         uncompress itcl-1.5.tar.Z
  72.         tar xvf itcl-1.5.tar
  73.  
  74.   3)  Run the configuration script:
  75.  
  76.         cd itcl-1.5
  77.         ./configure
  78.  
  79.       or, for systems that don't recognize "#!" in shell scripts:
  80.  
  81.         cd itcl-1.5
  82.         /bin/sh ./configure
  83.  
  84.       By default, the configuration script will set things up
  85.       to be installed in "/usr/local".  You can change this by
  86.       specifying a different "prefix" in the "configure" command:
  87.  
  88.         ./configure --prefix=/your/install/path
  89.  
  90.       You may be queried for the location of Tcl/Tk include files
  91.       and libraries.  Note that this package also requires the
  92.       path to the Tcl source code, since it requires "tclInt.h"
  93.       and this file is not usually installed with the standard
  94.       include files.
  95.  
  96.       The "configure" script generates new Makefiles from their
  97.       respective templates (Makefile.in).
  98.  
  99.       If "configure" can't find something, you can make changes
  100.       to the intermediate "config.status" script, and invoke this
  101.       script to reconfigure the Makefiles:
  102.  
  103.         vi config.status
  104.         ./config.status
  105.  
  106.       As a last resort, you can edit the Makefiles in "src/",
  107.       "man/" and "library/" by hand and insert the proper paths.
  108.  
  109.   4)  Build the libraries and the executables:
  110.  
  111.         make all
  112.  
  113.   5)  Test by running the demos:
  114.  
  115.         cd demos
  116.         ../src/itcl_wish -f coloredit
  117.         ../src/itcl_wish -f listboxes
  118.  
  119.   6)  Install the libraries (libitcl.a and libitcl.so.1.5) and the
  120.       executables (itcl_sh and itcl_wish), along with the man page
  121.       and library scripts onto your system:
  122.  
  123.         make install
  124.  
  125.  
  126. ADDING [incr Tcl] TO YOUR OWN APPLICATION:
  127.  
  128.   To add [incr Tcl] facilities to a Tcl application, modify the
  129.   Tcl_AppInit() routine as follows:
  130.  
  131.   1) Include the "itcl.h" header file near the top of the file
  132.      containing Tcl_AppInit():
  133.  
  134.        #include "itcl.h"
  135.  
  136.   2) Within the body of Tcl_AppInit(), add the following lines:
  137.  
  138.        if (Itcl_Init(interp) == TCL_ERROR) {
  139.            return TCL_ERROR;
  140.        }
  141.  
  142.   3) Link your application with libitcl.a
  143.  
  144.   NOTE:  Example files "tclAppInit.c" and "tkAppInit.c" containing
  145.          the changes shown above above are included in this
  146.          distribution.
  147.  
  148.  
  149. DEMO CLASSES:
  150.  
  151. Example classes in the "demos/widgets" directory illustrate how
  152. [incr Tcl] can be used to create new widgets that look (from a
  153. programming standpoint) like normal widgets but are written entirely
  154. in Tcl.  These widgets are defined as object classes, and pack
  155. primitive widgets together to provide higher-level functionality.
  156.  
  157. Two demos are provided which illustrate how these "mega-widgets"
  158. could be used in a real application:
  159.  
  160.     demos/listboxes .... Illustrates high-level listboxes:
  161.                            - ListBox
  162.                            - SelectBox
  163.                            - FilteredBox
  164.  
  165.     demos/coloredit .... Allows colors to be changed in another
  166.                          Tk application.  Illustrates:
  167.                            - FilteredBox
  168.                            - ColorEditor
  169.  
  170. Once you have created and installed the "itcl_wish" application which
  171. recognizes [incr Tcl] facilities, you can invoke these demos as:
  172.  
  173.     % cd demos
  174.     % itcl_wish -f listboxes
  175.     % itcl_wish -f coloredit
  176.  
  177. It is necessary to sit in the "demos" directory when running these
  178. scripts, since they need to access the class definition files that
  179. reside in the "widgets" directory below.
  180.  
  181.  
  182. LIBRARY ROUTINES:
  183.  
  184. The "library" directory contains a few useful Tcl procedures:
  185.  
  186.     library/itcl_mkindex.tcl .... the usual "auto_mkindex" proc
  187.                                   updated to include [incr Tcl]
  188.                                   classes when building an index
  189.  
  190.     library/itcl_reload.tcl ..... a series of procedures for
  191.                                   unloading and reloading class
  192.                                   definitions; useful when debugging
  193.                                   [incr Tcl] applications.
  194.  
  195.  
  196. SUMMARY:
  197.  
  198. Widgets provide a natural domain for object-oriented programming
  199. techniques.  They are not, however, the only domain.  I believe that
  200. [incr Tcl] can be used in more diverse applications to add structure
  201. to Tcl programs.  The "itcl_class" mechanism should be used to group
  202. related procedures and their shared data into a neat little package
  203. with a well-defined interface.
  204.  
  205. Please experiment with this facility and send me your comments.
  206.  
  207. --Michael
  208.  
  209.     =--===   ///////////////////////////////////////////////////////////
  210.   =-----====   Michael J. McLennan 2C-226    michael.mclennan@att.com 
  211.  =------=====  AT&T Bell Laboratories
  212.  ==----======  1247 S Cedar Crest Blvd        Phone: (610) 712-2842
  213.   ==========   Allentown, PA  18103             FAX: (610) 712-3843
  214.     ======   ///////////////////////////////////////////////////////////
  215.