2

I have an application that I am building am making use of Horizontal Line (which is just a special case of NSBox). I've placed the component into the interface, but what to adjust the thickness of the line.

NSBox has a setBorderWidth method, but doesn't seem to have this exposed when in Interface Builder. I would prefer not to do this manually, as I don't want to have to maintain an object simply to adjust this single value.

Is there a way to set this via Interface Builder that I am just missing?

Or, failing that, is there a better way to put a Horizontal Line in your UI such that you can control it's attributes via Interface Builder?

MarkPowell
  • 16,482
  • 7
  • 61
  • 77

2 Answers2

0

On the Attributes pane of the inspector, set the Border Type to Custom. Then on the Size pane, set the border width as needed.

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135
0

The best way is to instead add a Custom Box control (which is an NSBox), set its box type to Custom and its border type to Line.

Then set the control's height to 1 in the normal way, as well as its tint and whatever else you need.

The Horizontal Line control is really just a shortcut to get a NSBox that's been hard-coded to use the default separator line style; it doesn't allow you to configure much else. But, despite the name, it's neither the only nor arguably the best way to make a horizontal line.

Asteroids With Wings
  • 17,071
  • 2
  • 21
  • 35