Hi All.
Just a silly little question here.
While trying to learn about Declares, I saw a tutorial on using Apple’s built in about screen with Xojo.
I thought I bookmarked it, but now can’t seem to find it.
Does anyone know where this is located? If not, it isn’t a big deal.
Regards
I don’t know about a tutorial, but I do have the declare handy. You then add a credits.rtf
or credits.html
to your Resources folder and it displays within the window.
#if TargetMacOS then
declare function NSClassFromString lib "Cocoa" (aClassName as CFStringRef) as Ptr
declare function SharedApplication lib "Cocoa" selector "sharedApplication" (receiver as Ptr) as Ptr
var sA as Ptr = NSClassFromString("NSApplication")
sA = SharedApplication(sA)
declare sub OrderFrontStandardAboutPanel lib "Cocoa" selector "orderFrontStandardAboutPanel:" (receiver as Ptr, ID as Ptr)
OrderFrontStandardAboutPanel(sA, nil)
#endif
3 Likes
Thanks Tim.
Appreciated.
Now one more little question.
Since I am a self taught programmer, is there somewhere that there is a tutorial on how to use the “Declares” etc SIMPLY.
I went through the iOS example I found on the xojo youtube, but it made it clear as mud.
Regards
Declares are one of the more advanced features of the framework and I am not aware of any simple guides to them. Eugene Dankin has a book on Declares, but it’s for Windows.
Declares let you use APIs that aren’t available within the Xojo framework, be that a library you wish to include or a system level API like the About window we’ve used here. The documentation for declares will tell you how to form one, but you need to be comfortably familiar with both the Xojo framework and the API you wish to Declare into.
I think someone was working on a tool that writes declares from the Apple documentation, but I don’t know anything more about that project.