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

Insertion point not showing in the right place after delete

So i'm trying to get my NSTextView to syntax highlight some markdown. Here's what it looks like: but when I press the delete key, this happens: Does anyone know what's going on? In my - (void)textStorageDidProcessEditing:(NSNotification…
Mutahhir
  • 3,812
  • 3
  • 21
  • 26
0
votes
1 answer

How to create skype like message window?

I am just trying to design skype like message window , for this I have taken the NSDrawer element. It contains : a table view on left, menu items on top, text field on right bottom and text view at central portion on right side. Using text view I…
Devarshi
  • 16,440
  • 13
  • 72
  • 125
0
votes
1 answer

Range-related exception when subclassing NSTextStorage on Mavericks

My application uses my own subclass of NSTextStorage and everything worked fine until Mavericks. Even with the most stripped-down version, I get an exception as soon I init a text view with it. I read the documentation and also looked at How to…
0
votes
1 answer

calling objective c method from c function

I tried doing this in my objective C method my_function(self); my_function(void *param) { id self = param; [self.Output insertText:@"Hello world"]; } Output is of type NSTextView. I get the following errors in compilation Use of undeclared…
qwkslvr
  • 13
  • 3
0
votes
1 answer

Xcode- Make Textview continue horizontally forever

I am trying to make a basic text editor (For a School Project if you are wondering) and I want to make it work with different code. The problem is that I cant get TextView to go on forever horizontally. Similar to Notepad++. I have set it to have…
doglover129
  • 3
  • 1
  • 5
0
votes
1 answer

How do I display into an NSTextView properly? NSString / NSInputStream / NSTextView

#import "AppDelegate.h" @implementation AppDelegate @synthesize inputStream; @synthesize outputStream; @synthesize textField; @synthesize window; @synthesize aText; - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { …
0
votes
0 answers

NSTextView / Objective - C

Currently I am creating an application where I am receiving data from an inputstream. This data is set to an NSString pointer output. Currently, I am only able to display the output in a regular NSTextField window. My current code only allows for…
0
votes
1 answer

NSTextField and NSTextView : Overlapping Delegate Methods

I have a class which was the delegate for NSTextViews, for which I was interested in the textDidEndEditing: method. I now want it to also be the delegate for NSTextFields. Problem is, they both use the same method for signaling end of text…
Bertrand Caron
  • 2,525
  • 2
  • 22
  • 49
0
votes
1 answer

Scrolling an NSTextView to an exact rect?

I've got an NSTextView, inside an NSScrollView, and I want to scroll it to exactly where it used to be after repopulated the NSTextView with new data. So far, I've tried variations on the code below, but it never gets it quite right. What I need is…
MT.
  • 227
  • 1
  • 12
0
votes
1 answer

nstextview diable-like behavior on selection and input

I have a NSTextView: NSTextView *textView = [[NSTextView alloc] init]; [textView setTranslatesAutoresizingMaskIntoConstraints:NO]; [textView setDrawsBackground:NO]; [textView setRichText:YES]; [textView setSelectable:YES]; [textView…
Artemiy Sobolev
  • 324
  • 3
  • 7
0
votes
1 answer

NSTextView not dealloc'd until mouse moved (trashing Undo Stack?)

I have an NSTextView which I programmatically create within the content view of my window. Under certain circumstances I need to programmatically terminate the edit and destroy the NSTextView. When I do this (by setting first responder to nil,…
Scotty
  • 2,019
  • 1
  • 20
  • 31
0
votes
1 answer

NSTextView Images/Attachments

I understand NSTextView uses attachments for images inserted. Is there any way of accessing the images, or attachments, in an NSTextView?
Seb Jachec
  • 3,003
  • 2
  • 30
  • 56
0
votes
1 answer

How to change background only to some words in a textView

I need to change the background color of some particular words in a text that stay in a textView. Something similar to what happens in Firefox when you seearch for a word... So lets say I have a textView with this text "A man is sitting in front…
Blue
  • 2,300
  • 3
  • 21
  • 32
0
votes
0 answers

Displaying Cocoa UIComponents without dragging from Interface Builder and making Connections

I have three(can be many) parameters and their values like : School : Bomey School Degree : MBA Profession : Student I want to display above texts as it is on a view. But suppose the profession is Lecturer, I dont want to show the line…
0
votes
0 answers

NSTextView's NSTextStorage coming back null

I am following the OSX tutorial series on developer.apple.com and have run into a problem. When I paste or type text into the NSTextView and try to send it to the general pasteboard, the NSTextView returns a null string. I then tried to see if the…
Jack Stone
  • 37
  • 1
  • 6