Cocoa equivalent to HIAboutBox?

The Carbon declare HIAboutBox displays a standard About window. However, it’s not Retina-ready, and never will be.

Is there a ready-made Cocoa equivalent?

In Xcode’s documentation I’ve found found the orderFrontStandardAboutPanel method of the NSApplication class, but I’ve no idea how to form the declare in Xojo. I’m already using macoslib, if that helps.

Thanks all!

Ok, looks like I spoke too soon.

The basic Cocoa about box is now working, it’s tested and displays properly under retina.

(Note: NSApplication.App is part of macoslib)

soft declare sub orderFrontStandardAboutPanel lib CocoaLib selector "orderFrontStandardAboutPanel:" (id as Ptr) orderFrontStandardAboutPanel( NSApplication.App )

It is also in the MBS Plugins in NSApplicationMBS class.

Soft Declare Function SharedApplication Lib kCocoa Selector "sharedApplication" (receiver As Ptr) As Ptr Dim sA As Ptr = CocoaTJC.NSClassFromString("NSApplication") sA = SharedApplication(sA) Soft Declare Sub orderFrontStandardAboutPanel Lib kCocoa Selector "orderFrontStandardAboutPanel:" (receiver As Ptr, iD As Ptr) orderFrontStandardAboutPanel(sA, nil)

I cleaned up Thomas’s code for general purpose use:

[code]
Declare Function NSClassFromString Lib “Cocoa” (aClassName As CFStringRef) As Ptr
Declare Function SharedApplication Lib “Cocoa” Selector “sharedApplication” (receiver As Ptr) As Ptr

Dim sA As Ptr = NSClassFromString(“NSApplication”)
sA = SharedApplication(sA)

Declare Sub OrderFrontStandardAboutPanel Lib “Cocoa” Selector “orderFrontStandardAboutPanel:” _
(receiver As Ptr, iD As Ptr)

OrderFrontStandardAboutPanel(sA, Nil)[/code]

Hey! Are you implying my code is dirty?! :slight_smile: Thanks Paul.

Do I infer from this that one is not allowed to create one’s own About window?

You can create any About window you like. I have been using a MsgBox for the longest time for Apps in the Mac App Store, others design windows with all sorts of features …

The standard about dialog simply uses information from info.plist file and app icon.
Also you can localize those.