- /* ugly Carbon stuff following...
- * regrettably, you can't get the icons through clean Cocoa */
-
- /* retrieve our error icon */
- IconRef ourIconRef;
- int returnValue;
- returnValue = GetIconRef(kOnSystemDisk, 'macs', 'stop', &ourIconRef);
- errorIcon = [[NSImage alloc] initWithSize:NSMakeSize(32,32)];
- [errorIcon lockFocus];
- CGRect rect = CGRectMake(0,0,32,32);
- PlotIconRefInContext((CGContextRef)[[NSGraphicsContext currentContext]
- graphicsPort],
- &rect,
- kAlignNone,
- kTransformNone,
- NULL /*inLabelColor*/,
- kPlotIconRefNormalFlags,
- (IconRef)ourIconRef);
- [errorIcon unlockFocus];
- returnValue = ReleaseIconRef(ourIconRef);
-
- /* retrieve our caution icon */
- returnValue = GetIconRef(kOnSystemDisk, 'macs', 'caut', &ourIconRef);
- warnIcon = [[NSImage alloc] initWithSize:NSMakeSize(32,32)];
- [warnIcon lockFocus];
- PlotIconRefInContext((CGContextRef)[[NSGraphicsContext currentContext]
- graphicsPort],
- &rect,
- kAlignNone,
- kTransformNone,
- NULL /*inLabelColor*/,
- kPlotIconRefNormalFlags,
- (IconRef)ourIconRef);
- [warnIcon unlockFocus];
- returnValue = ReleaseIconRef(ourIconRef);
-