Non clickable NSToolbarItem label
Non clickable NSToolbarItem label
- Subject: Non clickable NSToolbarItem label
- From: Lorenzo <email@hidden>
- Date: Sun, 28 Oct 2007 08:29:15 +0100
Hi,
I add a NSButton to the toolbar.
If the user clicks on the NSToolbarItem icon I get the proper action.
But I cannot get any action when the user clicks on the label of the
NSToolbarItem. Instead, if I set just the image with
[item setImage:anImage]], the label is properly clickable. But I get a
distorted and smaller button. What do I miss?
id item = [[[NSToolbarItem alloc] initWithItemIdentifier:name] autorelease];
[item setPaletteLabel:name];
[item setLabel:name];
// if I use this, the label showing the name is clickable
// but the icons are distorted, even setting min and max size
[item setImage:[itemView image]];
// instead if I use this, the label showing the name is not clickable
// the icons are shown with the right size.
[item setView:itemView];
// no matter if I add this
SEL act = [itemView action];
id tar = [itemView target];
if(act && tar){
[item setAction:act];
[item setTarget:tar];
}
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
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