ftp.nice.ch/pub/next/connectivity/mail/apps/MailEnclosure.0.15.NIHS.bs.tar.gz#/MailEnclosure/Source.v0.15/DocumentController.m

This is DocumentController.m in view mode; [Download] [Up]

#import "DocumentController.h"
#import "StringStorage.h"

@implementation DocumentController

- init
{
   [super init];

   docType = [[StringStorage alloc] init];
   panel = nil;
   return self;
}

-free
{
   [docType free];
   return [super free];
}


- setDocType: (const char *) str
{
   [docType setStringValue: str];
   return self;
}

- makeKeyAndOrderFront:sender
{
   if(!panel)
   {
      char buf[MAXPATHLEN + 1];

      if(!*[docType stringValue])
      {
	 NXLogError("Opening a document with unknown nib name.");
	 return nil;
      }


      [[NXBundle bundleForClass:[self class]] 
            getPath: buf forResource: [docType stringValue] ofType:"nib"];
   
      [NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
   }
   
   [panel makeKeyAndOrderFront: sender];
   return self;
}

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.