home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Mail / Bundles / EnhanceMail-2.1-MIHS / HelpPanel.m < prev    next >
Encoding:
Text File  |  1997-10-31  |  1.6 KB  |  61 lines

  1. /* -*-C-*-
  2. *******************************************************************************
  3. *
  4. * File:         HelpPanel.m
  5. * RCS:          /usr/local/sources/CVS/EnhanceMail/HelpPanel.m,v 1.4 1997/11/01 00:19:26 tom Exp
  6. * Description:  
  7. * Author:       Carl Edman
  8. * Created:      Tue Oct 31 22:16:31 1995
  9. * Modified:     Sun Nov  5 10:20:25 1995 (Carl Edman) cedman@capitalist.princeton.edu
  10. * Language:     C
  11. * Package:      N/A
  12. * Status:       Experimental (Do Not Distribute)
  13. *
  14. * (C) Copyright 1995, but otherwise this file is perfect freeware.
  15. *
  16. *******************************************************************************
  17. */
  18.  
  19. #import "EnhanceMail.h"
  20. #import "HelpPanel.h"
  21.  
  22.  
  23. static id maybeAddSupplement(NXHelpPanel *helpPanel)
  24. {
  25.    static BOOL isLoaded = NO;
  26.    char path[MAXPATHLEN+1],*c;
  27.    
  28.    if (!isLoaded && helpPanel && EnhanceBundle &&
  29.        [EnhanceBundle getPath:path forResource:"EnhanceHelp" ofType:0])
  30.    {
  31.       for(c=path;*c;c++);
  32.       while((c>=path) && (*c!='/')) c--;
  33.       *c='\0';
  34.       [helpPanel addSupplement:"EnhanceHelp" inPath:path];
  35.       isLoaded = YES;
  36.    }
  37.    return helpPanel;
  38. }
  39.  
  40.  
  41. @implementation EnhanceHelpPanel
  42.  
  43. + finishLoading:(struct mach_header *)header
  44. {
  45.    EnhanceBundleInit();
  46.    [self poseAs:[self superclass]];
  47.    return self;
  48. }
  49.  
  50. + new
  51. {
  52.    return maybeAddSupplement([super new]);
  53. }
  54.  
  55. /* [TRH  1-Feb-97] Original +newForDirectory: override did not always work
  56.    when another Mail bundle loaded before EnhanceMail adds its help
  57.    supplement by the naive [[NXHelpPanel new] addSupplement:...] approach.
  58.    (EM is too smart for its own good:-/) */
  59.  
  60. @end // EnhanceHelpPanel
  61.