Setting a Box’s Title

You can have a box with no title or with a title positioned in one of six places. To set the title’s location, use setTitlePosition: with one of options listed below. By default, it’s NSAtTop.

NSAboveTopNSAboveTop

NSAtTopNSAtTop

NSBelowTopNSBelowTop

NSAboveBottomNSAboveBottom

NSAtBottomNSAtBottom

NSBelowBottomNSBelowBottom

NSNoTitleNSNoTitle

To set the title’s font, use setTitleFont:. By default, it’s the Control Content font, which you can set in the Fonts tab of the Appearance panel in the Preferences application. Note that the title appears inside the box, so changing the size of the font will affect the size of the box’s content rectangle.

To set the title, use setTitle:. By default, it’s “Title”. If the title is longer than the box’s width, the title is clipped.