RE: Best way to make Finder/Mail style toolbars?
RE: Best way to make Finder/Mail style toolbars?
- Subject: RE: Best way to make Finder/Mail style toolbars?
- From: Julius Oklamcak <email@hidden>
- Date: Sun, 09 Mar 2014 18:11:14 -0400
> What does the code you're using look like? (Also, are you on 10.9?)
The following works for me from 10.6 to 10.9 (I've left out code that
creates an NSSearchField, NSPopUpButton and NSTextField controls - all look
the same):
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar
itemForItemIdentifier:(NSString *)itemIdentifier
willBeInsertedIntoToolbar:(BOOL)flag
{
NSToolbarItem *toolbarItem = nil;
if ([itemIdentifier isEqualToString:kPrintControl])
{
NSButton *control = [[NSButton alloc] init]; // Print
NSButton
[control setTarget:self]; [control
setAction:@selector(menuPrintDocument:)];
control.bezelStyle = NSTexturedRoundedBezelStyle;
control.buttonType = NSMomentaryPushInButton;
control.toolTip = NSLocalizedString(@"PrintDocumentToolTip",
@"Tooltip");
control.image = [NSImage imageNamed:@"Icon-Print-Template"];
toolbarItem = [[NSToolbarItem alloc]
initWithItemIdentifier:kPrintControl];
[control sizeToFit]; toolbarItem.view = control;
}
else // ...
return toolbarItem;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden