anthony
anthony

Reputation: 41118

NSApplication orderFrontStandardAboutPanel: Making my about panel slightly less standard

What are my options, if any, of adding additional, arbitrary data to the standard Cocoa about dialog that is displayed by an NSApplication when it receives a orderFrontStandardAboutPanel message.

Upvotes: 11

Views: 7161

Answers (4)

arcdale
arcdale

Reputation: 196

Expanding further on the answers from Darrell Root and theMikeSwan above, Apple's documentation for the credits property of NSApplication.AboutPanelOptionKey states:-

The value of this key is an NSAttributedString displayed in the info area of the panel. If not specified, AppKit then looks for a file named “Credits.html”, “Credits.rtf”, and “Credits.rtfd”, in that order, in the bundle returned by the Bundle class method main. The first file found is used. If none is found, the info area is left blank.

Upvotes: 7

Darrell Root
Darrell Root

Reputation: 844

Expanding on theMikeSwan's answer, by accident I found that if you add a file named Credits.html to the Resources folder, it's contents get used in the expanded standard about panel. In fact Credits.html appears to override a Credits.rtf.

So your choice whether to use html or rtf format, or wire up "About" to a completely different custom window controller.

Upvotes: 2

theMikeSwan
theMikeSwan

Reputation: 4729

If you add a file named Credits.rtf to Resources the contents will automatically be used in the expanded standard about panel and you can put whatever info you want in the file. It will still pull the standard copyright, version info, etc from the info.plist. It is the easiest way I know of to add arbitrary info, otherwise you pretty much will have to roll your own about panel.

Upvotes: 22

Related Questions