• 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: desktop picture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >desktop picture (From: email@hidden)

  • Prev by Date: TIFFs and Resolution
  • Next by Date: Trouble with NSTableView
  • Previous by thread: Re: desktop picture
  • Next by thread: casting an int to string
  • Index(es):
    • Date
    • Thread