This is IKShelfInspector.m in view mode; [Download] [Up]
/* File IKShelfInspector.m Release 1.2, 7 June 1994 Copyright (C) 1994 by H. Scott Roy This code is part of IconKit, a general toolbox for drag-and-drop applications. IconKit is free for noncommercial use, but costs money for a commercial license. You should have received a copy of the license agreement with this file. If not, a copy of the license and the complete source of IconKit can be obtained from the author: H. Scott Roy 2573 Stowe Ct. Northbrook, IL 60062-8103 iconkit@cs.stanford.edu For your editing convenience, this file is best viewed using an editor that automatically wraps long lines, in a fixed point font at 80 columns, with tabs every 4 spaces. */ /* ========================================================================== */ /* This file implements a custom inspector for an IKCell. The inspector lets one set the editing, dragging, shelf behavior, title, and icon. */ #import "IKShelfInspector.h" #import "IKShelf.h" #import "IKCell.h" @implementation IKShelfInspector /* ========================================================================== */ - init { char path [MAXPATHLEN + 1]; id bundle; [super init]; bundle = [NXBundle bundleForClass: [IKShelf class]]; [bundle getPath: path forResource: "IKShelfInspector" ofType: "nib"]; [NXApp loadNibFile: path owner: self withNames: NO fromZone: [self zone]]; return self; } /* ========================================================================== */ /* Reset the various options as needed. This inspector is rather straightforward. Matching cells to the prototype copies all the flags, the image, and the title. */ - updateClassToHold: sender { [object setClassToHold: [classToHold stringValue]]; [self ok: sender]; return self; } - updateDynamic: sender { [object setDynamic: [sender state]]; [self ok: sender]; return self; } - matchCells: sender { int i; id prototype = [object prototype], cellList = [object cellList]; i = [cellList count]; while (i--) [[cellList objectAt: i] initFromCopy: prototype]; [self ok: sender]; return self; } /* ========================================================================== */ /* The ok: method does nothing. The revert method needs to initialize itself from the current selection. */ - ok: sender { [self touch: self]; return [super ok: sender]; } - revert: sender { [classToHold setStringValue: [object classToHold]]; [dynamic setState: [object isDynamic]]; return [super revert: sender]; } - (BOOL) wantsButtons { return NO; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.