Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with PlotCIcon and Intel mac



On 1/18/06 2:48 PM, Jeremy Sagan didst favor us with:

> That sounds good. I would like to use 'icns' resource with
> PlotIconRef. I am having trouble obtaining an iconref though. If I
> have an 'icns' resource in my main application resource file (which
> is in the app's bundle) how do I turn that into an iconref I can call
> ploticonref with?

I require 10.3 or later, so I use this:

OSErr CreateIconRef( IconFamilyHandle inIconFamily, IconRef &outIconRef )
{
    if ( inIconFamily == nil )
        return nilHandleErr;

    Size    hSize = GetHandleSize( ( Handle ) inIconFamily );
    
    return GetIconRefFromIconFamilyPtr( *inIconFamily, hSize, &outIconRef );
}

It's a little more work if you need to support 10.2, but it's doable.

Larry

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Problems with PlotCIcon and Intel mac (From: Jeremy Sagan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.