home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / Apps / DevTools / MachOViewer / Source / Document.m < prev    next >
Encoding:
Text File  |  1994-01-30  |  1.1 KB  |  64 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "Document.h"
  5. #import <appkit/Application.h>
  6. #import <appkit/Window.h>
  7.  
  8. /* $Log:    Document.m,v $
  9. Revision 1.2  94/01/30  16:24:54  ediger
  10. debug printf statement correction
  11.  
  12. Revision 1.1  93/12/19  13:08:17  ediger
  13. Initial revision
  14.  
  15.  */
  16.  
  17. static char rcsident[] = "$Id: Document.m,v 1.2 94/01/30 16:24:54 ediger Exp Locker: ediger $";
  18.  
  19. @implementation Document
  20.  
  21. - init
  22. {
  23.     D(printf("Document -init\n");)
  24.  
  25.     [super init];
  26.     [NXApp loadNibSection:"Document.nib" owner:self];
  27.  
  28.     return self;
  29. }
  30.  
  31. - openFileNamed:(char *)path
  32. {
  33.     D(printf("Document -openFileNamed:\"%s\"\n", path);)
  34.  
  35.     if (fileRep != Nil)
  36.     {    char  cBuf[256];
  37.         char *pcType;
  38.  
  39.         [fileRep openFileNamed:path];
  40.         pcType = [fileRep fileType];
  41.         
  42.         if (NULL == pcType)
  43.             sprintf(cBuf, "%s", (rindex(path, '/') + 1));
  44.         else
  45.             sprintf(cBuf, "%s - %s", (rindex(path, '/') + 1), pcType);
  46.  
  47.         [viewWindow setTitle:cBuf];
  48.     } else
  49.         fprintf(stderr, "Document -openFile:, fileRep is Nil\n");
  50.  
  51.     return self;
  52. }
  53.  
  54.  
  55. - show:sender
  56. {
  57.     D(printf("Document -show:%x\n", (unsigned int)sender);)
  58.     [viewWindow makeKeyAndOrderFront:self];
  59.     return self;
  60. }
  61.  
  62.  
  63. @end
  64.