Re: Non clickable NSToolbarItem label
Re: Non clickable NSToolbarItem label
- Subject: Re: Non clickable NSToolbarItem label
- From: Lorenzo <email@hidden>
- Date: Sun, 28 Oct 2007 18:30:48 +0100
I did set the size too, but no luck in case of setImage.
Instead in case of setView, yes, "set size" has effect.
Best Regards
--
Lorenzo
email: email@hidden
> From: David Spooner <email@hidden>
> Date: Sun, 28 Oct 2007 08:24:24 -0600
> To: Lorenzo <email@hidden>
> Subject: Re: Non clickable NSToolbarItem label
>
> I don't know if this will help, but I have often had to set the min
> and max size of the item in order for it to appear properly.
>
> dave
>
> On 28-Oct-07, at 1:29 AM, Lorenzo wrote:
>
>> 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
>>
>
_______________________________________________
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