This is ImageSubInspector.m in view mode; [Download] [Up]
//---------------------------------------------------------------------------------------------------- // // ImageSubInspector // // Inherits From: DefaultSubInspector // // Declared In: ImageSubInspector.h // // Disclaimer // // You may freely copy, distribute and reuse this software and its // associated documentation. I disclaim any warranty of any kind, // expressed or implied, as to its fitness for any particular use. // //---------------------------------------------------------------------------------------------------- #import "ImageSubInspector.h" #import "ImageView.h" #import <appkit/appkit.h> @implementation ImageSubInspector static id _SELF = nil; //---------------------------------------------------------------------------------------------------- // Initialization and Free Methods //---------------------------------------------------------------------------------------------------- + new { // Only allow one instance... if (_SELF) return _SELF; _SELF = self = [super new]; return _SELF; } //---------------------------------------------------------------------------------------------------- // Inspection Methods //---------------------------------------------------------------------------------------------------- - inspect: (STR) path { id image; if (! path) return self; image = [[NXImage alloc] initFromFile: path]; if (! image) return [self inspectionError: path]; [imageView image: image]; [imageView display]; [image free]; return self; } //---------------------------------------------------------------------------------------------------- // Accessing Inspection View //---------------------------------------------------------------------------------------------------- - clearInspectorView { // Clear view... [imageView image: nil]; [imageView display]; return self; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.