Re: desktop picture
Re: desktop picture
- Subject: Re: desktop picture
- From: "Pierre d'Herbemont" <email@hidden>
- Date: Thu, 23 May 2002 12:32:15 +0200
Le mercredi 22 mai 2002, ` 08:49 , email@hidden a icrit :
>
- (void)setDesktopPicture:(id)path
>
{
>
id desktop = [[[NSUserDefaults standardUserDefaults]
>
persistentDomainForName:@"com.apple.desktop"] mutableCopy];
>
id background = [[desktop objectForKey:@"Background"] mutableCopy];
>
int i, n = [background count];
>
id displayIDs = [background allKeys];
>
for (i = 0; i < n; i++) {
>
id did = [displayIDs objectAtIndex:i];
>
id display = [[background objectForKey:did] mutableCopy];
>
[display setObject: path forKey:@"ImageFilePath"];
>
[display setObject:@"Crop" forKey:@"Placement"];
>
[background setObject:display forKey:did];
>
}
>
[desktop setObject:background forKey:@"Background"];
>
>
[[NSUserDefaults standardUserDefaults] setPersistentDomain:desktop
>
forName:@"com.apple.desktop"];
>
[[NSUserDefaults standardUserDefaults] synchronize];
>
[[NSNotificationCenter defaultCenter]
>
postNotificationName:@"com.apple.desktop" object:@"BackgroundChanged"];
>
}
you should have use a distributedCenter
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"com.apple.desktop" object:@"BackgroundChanged"];
Hope this helps,
Pierre
_______________________________________________
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.