This is AlertPanel.m in view mode; [Download] [Up]
/* AlertPanel.h * Written By: Thomas Burkholder * * You may freely copy, distribute, and reuse the code in this example. * NeXT disclaims any warranty of any kind, expressed or implied, as to its * fitness for any particular use. */ #import "AlertPanel.h" @implementation AlertPanel - (void)buttonPressed:sender { lastResult = [sender tag]; [NSApp stopModal]; } - (int)lastResult { return lastResult; } - (void)run:sender { [self makeKeyAndOrderFront:sender]; [NSApp runModalForWindow:self]; [self orderOut:self]; } - alert { return alert; } - first { return first; } - iconButton { return iconButton; } - message { return message; } - second { return second; } - third { return third; } - (void)encodeWithCoder:(NSCoder *)aCoder { printf("in write\n"); [super encodeWithCoder:aCoder]; [aCoder encodeValuesOfObjCTypes:"@@@@@@i", alert,first,iconButton,message,second,third,lastResult]; } - (id)initWithCoder:(NSCoder *)aDecoder { printf("in read\n"); [super initWithCoder:aDecoder]; [aDecoder decodeValuesOfObjCTypes:"@@@@@@i", alert,first,iconButton,message,second,third,lastResult]; return self; } - (void)dealloc { [first release]; [second release]; [third release]; [iconButton release]; [message release]; [alert release]; [super dealloc]; } @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.