• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Programmatically Change Icon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programmatically Change Icon


  • Subject: Re: Programmatically Change Icon
  • From: "I. Savant" <email@hidden>
  • Date: Sun, 22 Mar 2009 18:19:08 -0400

On Mar 22, 2009, at 6:09 PM, Pierce Freeman wrote:

  Slightly-challenging-answer: Try it and see.

  Non-smarmy-answer: Yes. So would the other, more complicated
approach.

Just tried it, and it works great... Thanks! Just two questions so far:


1. How can I get different sizes of the icon, or are they just linked to the
size of the outlet?

I suggest some reading:

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/nsimage_Class/Reference/Reference.html

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Images/Images.html

http://developer.apple.com/documentation/Cocoa/Conceptual/ImageView/ImageView.html


2. If you link to a non-existent application, it still returns an image - Is
there some way to set it to return an error if this happens?

This is what I'd expect ... if an application has no custom icon, it gets the standard, generic application icon. In this case, you'd probably want to go with the "get the app icon file name, then ask the app bundle for the resource of that name" route. This way, if there's nothing set for the app icon key, you'll know there's no custom icon. If so, you can just use the NSWorkspace call to get that custom icon.


--
I.S.




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Programmatically Change Icon
      • From: Pierce Freeman <email@hidden>
References: 
 >Re: Programmatically Change Icon (From: Pierce Freeman <email@hidden>)

  • Prev by Date: Re: Programmatically Change Icon
  • Next by Date: Re: Explicit release when using garbage collection with circular references
  • Previous by thread: Re: Programmatically Change Icon
  • Next by thread: Re: Programmatically Change Icon
  • Index(es):
    • Date
    • Thread