• 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
NSToolbar setConfigurationFromDictionary: ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSToolbar setConfigurationFromDictionary: ?


  • Subject: NSToolbar setConfigurationFromDictionary: ?
  • From: Dan Saul <email@hidden>
  • Date: Sat, 17 Jul 2004 17:56:16 -0500

Hi, I'm currently trying to change the content of an NSToolbar at
will, I've tried removing all the items (snippet 1), but that did not
work, I am currently working on a configuration dictionary (snippet
2), but i haven't had much luck with that either. Can someone look at
my code and tell me what I am doing wrong, or one that points to a
tut. using a configurationDictionary? Thanks in advance!

Snippet 1:
// Get number of items in toolbar
NSArray * itemsInToolbar = [[mainWindow toolbar] items];
NSLog([NSString stringWithFormat:@"%@", itemsInToolbar ]);
unsigned int c = [itemsInToolbar count];
NSLog([NSString stringWithFormat:@"%i", c ]);

// Remove all items
int i;
for(i=0;i<c;i++) {
[[mainWindow toolbar] removeItemAtIndex:i];
}
Snippet 2:
NSMutableDictionary * grItems;
[grItems setObject:[[NSArray alloc] initWithObjects:
@"Game",
@"GetList",
@"Reload",
@"Servers",
@"ServerRoom",
@"Favorites",
@"Chat",
@"Filter",
@"AddFavorite",
@"RemoveFavorite",
NSToolbarSeparatorItemIdentifier,
NSToolbarFlexibleSpaceItemIdentifier, nil] forKey:@"TB Display Mode"];

[[mainWindow toolbar] setConfigurationFromDictionary:grItems];
_______________________________________________
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.


  • Prev by Date: Re: my arrays are being deallocated, and i dky
  • Next by Date: Re: iChat perspective view
  • Previous by thread: Re: Forward delete Key and IB
  • Next by thread: Expression parsing
  • Index(es):
    • Date
    • Thread