home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / ANSIshellƒ / HowTo eConsole < prev    next >
Encoding:
Text File  |  1993-08-05  |  3.0 KB  |  83 lines  |  [TEXT/KAHL]

  1. 05Aug93  e
  2.  
  3. eConsole adds a scrollable two-style interaction window, as well as a 
  4. program editor to Mac applications which use the ANSI Library. It also
  5. handles menus, and edit window preferences. See eConsole User Notes.
  6.  
  7. How To Add eConsole to you ThinkC project...
  8.  
  9. eConsole is a ThinkC console/gui replacement. It is intended to be used
  10. with one of ThinkC's ANSI projects. To include it in your ThinkC project
  11. you should do the following...
  12.  
  13.  [this is a cryptic - comments welcome]
  14.  [You must know how to use ThinkC & program for the Mac..]
  15.  
  16. I assume that you currently include a ThinkC ANSI project in your project;
  17. you will also need to include MacTraps and MacTraps2. In ThinkC 5 (but not
  18. in ThinkC 6) include PrGlue as well. It doesn't matter what segment these
  19. are in, so long as no segment is bigger than 32K.
  20.  
  21. Copy the ANSI project of your choice and rebuild it without console.c
  22. Replace the ANSI project in your project with the new version.
  23.  
  24. Your project should have a <signature>. These are officially only available 
  25. from Apple, so if you're distributing your application, get an official
  26. signature. If the application is for your own use only, just pick a four
  27. character sequence that doesn't conflict with any of the applications you
  28. have installed on your Mac. [The SML/NJ signature is 'NJML']
  29.  
  30. You must place the <signature> for your project in the Creator box in the 
  31. ThinkC's Set Project Type... dialog. While you're there, set the Type box
  32. to 'APPL' and the Size Flags to 50C0
  33.  
  34. Include the resources of eEdit.rsrc in your project's resource file. If
  35. there are any resource numbering conflicts you will either have to renumber 
  36. your resources, or renumber mine and change os_mac.h
  37.  
  38. If your project doen not have a resource file, copy eEdit.rsrc and rename 
  39. it to <your-project-name>.rsrc
  40.  
  41. Your resource file should also have appropriate BNDL FREF and ICN# resources 
  42. in order for AppleEvents and Finder Drag & Drop to work correctly.
  43.  
  44. Include the following C files in your project:
  45.  os_mac.c
  46.  os_mac_console.c
  47.  os_mac_eKeys.c
  48.  os_mac_eStyle.c
  49.  os_mac_eEdit.c
  50.  os_mac_Print.c
  51. Again, it doesn't matter what segment these are in, so long as no segment 
  52. is bigger than 32K. In SML/NJ the first two C files are in a segment with
  53. MacTraps and MacTraps2, and the last four C files are in their own segment.
  54.  
  55. You should place the following header files where ThinkC will see them:
  56.  os_mac.h
  57.  os_mac_eEdit.h
  58.  os_mac_eventchk.h
  59.  AERegistry.h     (or a newer version, if you have it, from Apple)
  60.  
  61. Edit the file os_mac.h changing these lines:
  62. #define PREFS_FILENAME "\pTricia Preferences"
  63. #define CREATOR 'TMcM'
  64.  
  65. The PREFS_FILENAME is the filename for the preferences file. This file will
  66. be created in the System Folder:Preferences Folder. The CREATOR is the 
  67. <signature> described above.
  68.  
  69. You must also define a void doAbout(void); It should display an about dialog.
  70. Here's a simple example:
  71. extern void doAbout(void)
  72. {    DialogPtr dlg;
  73.     short i;
  74.     dlg=GetNewDialog(about_dlogID,NULL,(WindowPtr)(-1L));
  75.     ModalDialog((ModalFilterProcPtr)NULL,&i);
  76.     DisposDialog(dlg);
  77. }
  78.  
  79. Good luck.
  80.  
  81. e
  82.  
  83.