I set textContainerInset for NSTextView for some values.
self.textView.textContainerInset = NSMakeSize(10, 10);
How to make a selection of text in the input area? A text cursor appears, but nothing happens if I try to select a text area inside this insert.
Here is an additional code example that you can add to an empty Cocoa application project to see this behavior.
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { NSTextView *textView = [[NSTextView alloc] initWithFrame:self.window.contentView.bounds]; textView.string = @"1\n2\n3\n4\n5"; textView.textContainerInset = NSMakeSize(10, 10); [self.window.contentView addSubview:textView]; }
objective-c cocoa nstextview
Berry blue
source share