RE: Changing Desktop picture from Cocoa app in 10.1 without re-starting Finder [Success!]
RE: Changing Desktop picture from Cocoa app in 10.1 without re-starting Finder [Success!]
- Subject: RE: Changing Desktop picture from Cocoa app in 10.1 without re-starting Finder [Success!]
- From: "Mark Orchard" <email@hidden>
- Date: Sat, 27 Oct 2001 03:24:01 +1000
Thanks to all who replied.
I managed to get com.apple.desktop.plist into an NSMutableDictionary, write
a property for the correct key and write the dict. back to file.
Jonathan's distributed notification was the key. The desktop picture changed
without re-starting the Finder. Strangely enough, although the picture
changed, the Desktop Pref. Pane doesn't update (in 10.1), so I guess it
doesn't subscribe to the "com.apple.desktop" notif. with the
"BackgroundChanged" message/data.
Speaking of these particular messages, are they publicly documented
anywhere? This one was a real nugget. Maybe you have to be a paid up member
of the Developer Program to see these things ;-)
Anyway, I'm very happy at the moment although I know this is going to break
in some future OS revision. Writing directly to plists is too low-level.
I'll only feel comfortable about non-breakage of my app. if Apple supply a
higher level API for writing User property lists in some AppKit somewhere.
I wonder what Apple's official position is on application's writing directly
to property lists?
I'd assume that it would be totally unsupported but I also get the
impression that a lot of developers are doing it!
Thanks again,
Mark Orchard
IT Network Specialist
IPMS Application Manager/Developer
iTech
(03)9634 7465
email@hidden, email@hidden
-----Original Message-----