This is MMDocumentCell.m in view mode; [Download] [Up]
/* * You may freely copy, distribute and reuse the code * in this example. Scott Anguish disclaims any warranty of * any kind, expressed or implied, as to its fitness * for any particular use. * Please keep this notice intact * Written by: Scott Anguish sanguish@digifix.com */ #import "MMDocumentCell.h" #import <libc.h> /* MAXPATHLEN */ #import <stdio.h> #import <strings.h> #import <appkit/appkit.h> #import <streams/streams.h> @implementation MMDocumentCell:MMCell - imageFromFilename:(const char *)filename { if (!theImage) { theImage=[[Application workspace] getIconForFile:filename]; if (!theImage){ theImage = [[NXImage alloc] initFromFile: "/usr/lib/nib/default_app_icon.tiff" ]; } } return self; } - imageFromAttachment { char filename[MAXPATHLEN+1]; sprintf(filename,"/tmp/%s",attachmentName); [self imageFromFilename:filename]; return self; }; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.