Questions tagged [nstextview]

NSTextView is the front-end class to MacOS's Application Kit text system. It draws the text managed by the back-end components and handles user events to select and modify its text. While NSTextView is a subclass of NSText—which declares the most general Cocoa interface to the text system—NSTextView adds major features beyond the capabilities of NSText.

Text views are user interface objects instantiated from the NSTextView class. Text views typically display multiple lines of text laid out in paragraphs with all the characteristics of sophisticated typesetting. A text view is the main user interface to the Cocoa text-editing system. It handles user events to provide text entry and modification, and to display any font, including those of non-English languages, with arbitrary colors, styles, and other attributes.

The Cocoa text system supports text views with many other underlying objects providing text storage, layout, font and attribute manipulation, spell checking, undo and redo, copy and paste, drag and drop, saving of text to files, and other features. NSTextView is a subclass of NSText, which is a separate class for historical reasons. You don’t instantiate NSText, although it declares many of the methods you use with NSTextView. When you put an NSTextView object in an NSWindow object, you have a full-featured text editor whose capabilities are provided “for free” by the Cocoa text system.

871 questions
0
votes
1 answer

Auto scrolling to the end of NSTextView

I have a NSTextView on which I am appending console logs. I have implemented this UI in XIB file with scroll views. When my application appends the console logs in the text view, I want the scroll bar to automatically go to the end of the textview.…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
0
votes
1 answer

NSLeftTextAlignment with spaces at end of string

if I sets NSCenterTextAlignment for my NSTextView my whitespaces at the end of string magically disappears for example I have string @"while " if I display it with NSRightTextAlignment it shows well |white | but with NSLeftTextAlignment…
user840250
  • 727
  • 1
  • 8
  • 20
0
votes
1 answer

NSTextView inherits parents view background on update

I have a NSTextView that I am using to display a timer. This timer updates every second counting down to 00:00. When the timer updates the string for the NSTextView, the NSTextView acts as if it redraws but uses its parents views background for its…
0
votes
1 answer

Handle textDidChange Method in NSTextView

I want trigger the event if the text is changing in my NSTextView. Is there a way to trigger that directly from the NSTextView or I have to create a custom Class for the NSTextView?
Chryb
  • 547
  • 1
  • 12
  • 34
0
votes
1 answer

Get command input from NSTextView

OK, this what I have in mind : I have an NSTextView I'm using as a "Console"/"Terminal" I want to be able to process user input on "enter" When user enters something and presses "return", I want to be able to process that input Is there anything…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223
0
votes
3 answers

Changing the font of the selected text in Objective-C

I'm trying to create a custom “Change font” NSPopupButton for a Mac App (not an iOS App). I can detect a change in font selection: long fontItemIndex = [fontPopup indexOfSelectedItem]; NSMenuItem *fontItem = [fontPopup…
Joeri van Veen
  • 202
  • 1
  • 2
  • 9
0
votes
1 answer

Shell Command output in NSTextView

Thanks for the help. The results of this executed command is displayed in my Xcode Console. What's the best way to get the results of the command to be displayed in an NSTextView? NSString *commandToRun = @"~/Library/webREF/ffmpeg -nostats -i…
Paul
  • 189
  • 10
0
votes
0 answers

Modify multiple NSTextView with commands

I'm wondering if anyone knows if it is possible to modify multiple NSTextViews with a menu bar command. For example if the user selects "Bold" from the menu bar, the different NSTextViews that are selected update all their content to show…
schmudu
  • 2,111
  • 1
  • 21
  • 30
0
votes
1 answer

NSTextView, NSTextStorage and circular log?

I've a NSTextView in the application window that shows a log of incoming data of a serial port. I append text to the log as it arrives to the application: NSAttributedString* attrString = [[NSMutableAttributedString alloc] initWithString:…
joanba
  • 281
  • 2
  • 15
0
votes
1 answer

Extend NSTextView or implement NSTextInputClient?

I'm trying to implement a text editing component with certain characteristics and I wonder what is the best route, extend NSTextView or implement NSTextInputClient. The text component should obviously support UTF-8 and attributed text. I also want…
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
0
votes
2 answers

Hide NSTextView while some process is running

My code is something like this: - (void)buttonClick { [self.progressIndicator startAnimation:self]; [self.textView setHidden:YES]; // some process [self.progressIndicator stopAnimation:self]; [self.textView setHidden:NO]; } The…
0
votes
0 answers

NSTextView with shadow

I'm trying to add a nice looking shadow to a NSTextViews string, I have this Code so far: NSShadow *textShadow = [[NSShadow alloc] init]; textShadow.shadowColor = [[NSColor blackColor] …
miradorn
  • 75
  • 6
0
votes
1 answer

How to tell which NSTextField was edited?

My NSDocument subclass adopts NSTextFieldDelegate. The document window contains several NSTextField instances (all setup as outlets of the document class). When the user edits a text field, I want my document to be notified. But all the methods in…
Nicolas Miari
  • 16,006
  • 8
  • 81
  • 189
0
votes
1 answer

Link NSDocument's changeCount to NSTextView

Is there a way to somehow link an NSDocument's changeCount to the only NSTextView that is used for a document? Or so I have to implement all the necessary NSTextViewDelegate methods and update the changeCount myself?
Jawap
  • 2,463
  • 3
  • 28
  • 46
0
votes
1 answer

How to get the line spacing of NSTextView?

How can I get the line spacing of NSTextView?
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140