Warning Icon

I would like an icon 1 type image for a custom warning window using the app icon or a different one. I have no idea how, I couldn’t find anything in NSImage, I thought:

set cautimg to NSImage's imageNamed_("NSImageNameCaution")--a constant
set newimg to NSImage's alloc()'s initWithContentsOfFile_(cautimg)
valwinimg's setImage_(newimg)

It didn’t work and then I remembered it didn’t do anything to my icon.

There’s a nice caution icon in /System/Library/Frameworks/IOBluetoothUI.framework/Versions/A/Resourses/. You could use it, since everyone has it.

Sorry I may have lost you, I just want the icon 1 affect with any icon using cocoa. That’s not a very good one anyway, I use much of /System/Library/CoreServices/CoreTypes.bundle.

In Cocoa you could subclass NSView and draw the two layers (main and miniaturized icon) one after another

No but surely a method already exists, it is in AS dialogs and other apps.

The dialogs are actually C functions

Not Obj-C?

Look at Application Kit Functions

Don’t see anything :confused:

These are the alert and information panels

NSBeginAlertSheet
NSBeginCriticalAlertSheet
NSBeginInformationalAlertSheet
NSGetAlertPanel
NSGetCriticalAlertPanel
NSGetInformationalAlertPanel
NSReleaseAlertPanel
NSRunAlertPanel
NSRunCriticalAlertPanel
NSRunInformationalAlertPanel

The icons are “hard-coded”. As far as I know there is no method to create a composite icon.
But as mentioned above, you can draw the icons as layers in a NSView subclass overriding the drawRect: method