home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / utils / graphic / convrtrs / mac / tchtxtgr.hqx / TeachText Graphics
Encoding:
Text File  |  1993-05-31  |  3.6 KB  |  48 lines

  1. Note:  This document looks best with at least 256 colors.
  2.  
  3.  
  4.  
  5.  
  6.   If you would like to know how to include graphics, such as the above title, in TeachText documents, the most authoritative source is the Apple Technical Note titled "The Compleat Guide to TeachText".  It can currently be downloaded by anonymous FTP from ftp.apple.com, as dts/mac/tn/platforms.tools/compleat-teachtext.hqx.  The document you are reading does not intend to replace the tech note, it's simply a quick and dirty reference and example of how to do it.
  7.  
  8.  
  9.  
  10.   The first thing you should do is use TeachText to write your text file. Don't worry about the graphics yet, but start thinking about where you would like to put them.
  11.  
  12.   When you are done writing the text, make the graphics in either a draw program or a paint program. When you are done with it, use the lasso or marquee tool to select the smallest area encompassing the graphic and copy it to the scrapbook. It is best to use a painting program, rather than a draw program, because then the PICT will be in bitmap format instead of vector (line) format. If you do copy to the scrapbook from a draw program, you will have to copy it then from the scrapbook into a paint program anyway, and then back to the scrapbook again, so it's best to just start with the paint program.
  13.  
  14.   After you have the graphic stored in the scrapbook, open the text file you created with ResEdit.  If you don't have ResEdit you can also FTP that from ftp.apple.com.  When you first open the text file you will get a dialog box informing you that the file doesn't have a resource fork and asking you if you want to create one.  Go ahead and create it.
  15.  
  16. The newly created resource fork will be empty.  Open the scrapbook and copy the graphic you want to paste in the TeachText document.  Get back to ResEdit and select paste from the Edit menu.  Use should now see a PICT resource.  Double click on the PICT resource and you'll see a miniture representation of your graphic.  Hold down the command key and press I.  You'll get the information box for the PICT.  Change the ID, which will probably be 128, to 1000.  Also make the resource purgeable.  Save the file in ResEdit and close it.
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. Now open the file with TeachText.  Scroll to the part of the document that you want the graphic to be pasted into.  On a blank line, hold down the option key and press the space bar.  Now press the carriage return a few times to make room for the graphic.  You probably won't see it yet, so click on the zoom box twice. You should now see your graphic.
  31.  
  32. The option-space characters are placeholders for the graphics.  The PICT's must be stored in the resource fork of the text file, and they must be numbered consecutively starting at 1000.  Everytime TeachText sees an option-space character in a file, it will attempt to load the next consecutively numbered PICT.  The graphics are only updated whenever the window is resized or scrolled.  If a change is made to a nearby line, the graphic may disappear.  Resize the window to make it reappear again.
  33.  
  34. To prevent this disappearing and reappearing of the graphics to the end user, use ResEdit again to change the file type of the document from TEXT to ttro (case is significant).  This will convert the TeachText file from an editable document to a read-only "newspaper" type file.
  35.  
  36. I hope this helps you.  I want to thank the readers of the Info-Mac digest for pointing me in the right direction when I was trying to figure out how to do this.  If you have any questions, or if you want to talk about anything in general, you can reach me at the addresses below.
  37.  
  38.  
  39. Dan Rolander╩
  40. Internet:  rolander@aol.com
  41. or drolander@lando.hns.com
  42. AOL:  Rolander
  43.  
  44.  
  45.