What I want to do is modify the dock icon while the application running. The only interface I can find to do this is NSApp.setApplicationIconImage: , which requires an NSImage. I have no way to get at the actual view being used to draw the dock icon, in order to subclass it; I have to create a new NSImage somehow, and pass that to setApplicationIconImage.

There has been some confusion in the discussion so far, most of it my fault for using the wrong terminology by mistake. What I want to modify is the dock ICON, not the dock TILE. The doc tile is the tiny image of the application main window that appears in the dock when you minimize the application. The dock icon is (usually) the regular application icon, that appears in the dock when the application is launched, and which you may have sitting there permanently for ease of access to a commonly used application. There is an interface for making run-time changes to the view used for drawing the dock tile; namely NSDockTile.setContentView: , but I do not find such an interface for the dock icon.

This discussion is in some jeopardy of ratholing into off-list topics like proper use of the dock and what constitutes consistent user interface behavior for application icons. Maybe we should stick to a basic technical question, which is possibly of broader interest:

    What is the Cocoa way to alter an NSImage
    dynamically (or perhaps alter a copy of
    an original image), at run-time, while
    preserving as transparent any transparent
    areas it may have to begin with?

The best I have got at the moment is outrageous hackery at the pixel level in the bit map; there ought to be something better ...

--  Jay Reynolds Freeman
---------------------
jay_reynolds_free...@mac.com
http://web.mac.com/jay_reynolds_freeman (personal web site)

Well, mea culpa, I have not been speaking clearly; what I want to badge is not the dock tile but the dock icon,

Not sure I understand what you're talking about. Do you mean to modify the application's icon even when it isn't running? There is no API to achieve this at this time.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to