NSToolbarItemGroup is documented here. I can't find much more than that about it!
I'm trying to use it, to see how it looks. My code is basically lifted directly from the documentation. However, I never see the 'group' in my toolbar. The code runs, and the item gets added to the toolbar, but it's just not visible?!
Has anyone had success with using this? Environment is 10.8.3 with latest XCode.
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar
{
return [NSArray arrayWithObject:@"GroupItem"];
}
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar
{
return [NSArray arrayWithObject:@"GroupItem"];
}
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
{
NSToolbarItem *item1 = [[NSToolbarItem alloc] initWithItemIdentifier:@"Item1"];
NSToolbarItem *item2 = [[NSToolbarItem alloc] initWithItemIdentifier:@"Item2"];
[item1 setImage:[NSImage imageNamed:NSImageNameQuickLookTemplate]];
[item2 setImage:[NSImage imageNamed:NSImageNameQuickLookTemplate]];
[item1 setLabel:@"Prev"];
[item2 setLabel:@"Next"];
NSToolbarItemGroup *group = [[NSToolbarItemGroup alloc] initWithItemIdentifier:@"GroupItem"];
[group setSubitems:[NSArray arrayWithObjects:item1, item2, nil]];
[group setLabel:@"Navigate"];
return group;
}