Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Padding in NSTextView -- possible without custom drawing?

In Cocoa, NSTextView has a rather shallow margin between text and border. Is there a way to specify a padding (distance between text and border of view) for a NSTextView without resorting to owner drawing?

like image 253
taco Avatar asked Nov 25 '08 21:11

taco


1 Answers

The NSTextView method setTextContainerInset: does what you're looking for. The height and width components of the NSSize parameter specify the vertical and horizontal padding amount respectively.

For example

textView.textContainerInset = NSSize(width: 8, height: 8)
like image 78
Boaz Stuller Avatar answered Sep 28 '22 06:09

Boaz Stuller