Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
- Subject: Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar
- From: Richard Charles <email@hidden>
- Date: Fri, 09 Oct 2015 09:21:52 -0600
> On Oct 9, 2015, at 7:41 AM, Jacek Oleksy <email@hidden> wrote:
>
> HI All,
> I am creating custom toolbar and placing some buttons in it. I want it
> to look as close to native toolbar as possible (and no, sadly I cannot
> use NSToolbar).
Are you subclassing NSToolbar? NSToolbarItem has a view property that you can set to use NSButton if you wish. This can be done programmatically but not sure how to do it in Interface Builder (Xcode).
> The problem is that when I put NSButton on the custom toolbar with
> NSTexturedRoundedBezelStyle, its height is 22 pixels. However, if a
> button like this is put on NSToolbar, it gets a height of 24 pixels.
Programmatically you can set the button height to what ever you want.
> Anyone has a clue what is going on here? Does button is somehow aware
> that it is put in NSToolbar and changes its appearance?
I have noticed that Apple has tweaked the “standard” height of some controls over the years (at least I think that is the case). It is probably more common for a toolbar item to have an image not a button. It may be that Apple is trying to force compliance to a guideline in this regards. But the height of a button should not matter as long as visually it is what you want and displays properly.
When trying to duplicate the look and feel of some controls found in Apple applications be aware that you might not get there using default values. I think this is especially true in toolbars.
--Richard Charles
_______________________________________________
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