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: Chaning Desktop picture with cocoa



On 8 Jul 2004, at 01:19, Nick Zitzmann wrote:

On Jul 7, 2004, at 1:35 PM, Kodex wrote:

I know it has been done before but i cant seem to find
any infomation on it anywhere. I am trying to change
the desktop picture from within an application without
restarting the finder.

The Finder doesn't control the desktop picture; the Dock does.

Bzzt. The window is actually owned the by the WindowServer (according to Quartz Debug in Mac OS X 10.3.4). However, this is an implementation detail you shouldn't care about - and I'm pretty sure this is a change since earlier versions, when the Finder put up its own desktop picture window (pre-10.2 I believe the desktop icons were composited into the Finder's desktop window atop the desktop picture, meaning you couldn't insert your own window between the desktop picture and the desktop icons -- however this has been resolved).

At no time has the Dock ever owned this window, AFAIK.

Anyway, this can be done using NSDistributedNotificationCenter; download Notification Watcher at <http://www.tildesoft.com/Programs.html> and watch what happens in Notification Watcher when you change the desktop picture from System Preferences.

The distributed notification is an implementation detail and has never been documented anywhere. Don't rely on it. The correct method is to send an AppleEvent to the Finder. See <http://developer.apple.com/samplecode/DeskPictAppDockMenu/ listing3.html> for code demonstrating this.

-- Finlay
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Chaning Desktop picture with cocoa (From: Kodex <email@hidden>)
 >Re: Chaning Desktop picture with cocoa (From: Nick Zitzmann <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.