realbasic-nug
[Top] [All Lists]

Re: "Resource not found!" error

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: "Resource not found!" error
From: Norman Palardy <npalardy@great-white-software.com>
Date: Wed, 31 Dec 2008 10:12:07 -0700
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <219953.14077.qm@web65606.mail.ac4.yahoo.com>
References: <219953.14077.qm@web65606.mail.ac4.yahoo.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

On 31-Dec-08, at 9:50 AM, Lennox Jacob wrote:

Thanks Thom,

I did this:

'This example gets the desktop application icon for Photoshop® and displays it in a Canvas control.
 #if TargetMacOS then
   Dim rf as ResourceFork
   Dim f as FolderItem
   Dim p as Picture
'f= GetFolderItem("Photoshop") I don't have Photoshop, but I have Safari f= SpecialFolder .Applications .child ("Safari .app").child("Contents").child("Resources").Child("compass.icns") f.launch 'This launches Preview and displays the compass as a picture

How could I get the Compass displayed as a picture in Canvas1?

You should use a "well documented API" to get the icon instead of reading it directly from the icns file like this
Apple provides API's for this

Charles Yeomans MacOSLIb (see http://code.google.com/p/macoslib/) has that implemented and can grab an icon as a picture from a fodler item
And there's an example of this in there as well
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>