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

Xcode Like log with NSTextView

I'm trying to set up a NSTextView like the console in Xcode (or pretty much any other IDE available). That being the user cannot edit the NSTextView, however they can put in a character when appropriate, I'm trying to set up that same functionality.…
ManOx
  • 1,935
  • 5
  • 23
  • 37
0
votes
1 answer

Display Console output to a control in app

My Cocoa app has a debug mode that displays additional window in which I'd like to present NSLog output (just like the Console window in Xcode). I already have a custom NSlog method, which saves the output to a file as well. Which control should I…
Thunder
  • 611
  • 1
  • 8
  • 25
0
votes
1 answer

Editing text in NSTextView while my app is running

I have the following code where I create a textLabel. Although I have [textView setEditable:YES]; in this chunck of code, I still can't edit the text inside the textbox while my app is running. What am I doing wrong here? -(NSView *)elementView…
Elendas
  • 733
  • 3
  • 8
  • 22
0
votes
1 answer

How do I set a Custom NSFormatter to a NSTextView?

I have a NSTextView and i have a custom NSFormatter that limits the string length. But how do i "[_textView setFormatter:customFormatter]" on a NSTextView? I can't find how to do that. Example code would be appreciated!
Pedro Vieira
  • 3,330
  • 3
  • 41
  • 76
0
votes
1 answer

NSTextView quote level

I'm using a custom subclass of NSTextView in my project, and I'd like to know if someone knows a way to display graphics in them in the fashion Mail.app from Apple does when showing text being replied to. Like this: I read on SO in another message…
0
votes
1 answer

How to link NSTextView from nib to windowController?

I created an outlet property for NSTextView in an window controller file. I then created a separate window xib file with a NSTextView in it. How do I link the view object in the xib file to the outlet in the window controller file?
Standstill
  • 399
  • 4
  • 17
0
votes
1 answer

Text token inside NSTextField

I'm trying to create a NSTextField to allow batch renaming of some files. This field should allow to insert some tokens to customize each filename. The problem with NSTokenField is that 1) it trims whitespaces, which should be allowed, 2) it doesn't…
Nickkk
  • 2,261
  • 1
  • 25
  • 34
0
votes
1 answer

how to show gif image in NSTextView

I am new to mac developing. I am developing an app about richEdit by subclassing NSTextView. In my customized textView, I can insert image like .bmp .jpeg .png. Code is like this: NSTextAttachment* attachment; NSImage *image = [[NSImage alloc]…
scarlett
  • 9
  • 2
0
votes
1 answer

Saving contents of NSTextView with graphics

Thanks for the help. I need to save my RTF's with graphics. The following works fine for text. What do I need to do to make this work with embedded graphics? thanks again. paul. NSSavePanel *panel = [NSSavePanel savePanel]; [panel…
Paul
  • 189
  • 10
0
votes
1 answer

NSTextView or NSTextField automatically resize bounds / frame?

I'm trying to use either an NSTextView or NSTextField which displays text that I am adding via textField.stringValue = [dictionary objectForKey:@"info"]; The problem is I need the bounds / frame of the text area to vertically re-size to show all of…
Desh__
  • 899
  • 1
  • 10
  • 16
0
votes
1 answer

How to loop through subviews in order to get the text of NSTextViews

I have a NSView which contains several instances of NSTextView. I would like to get the content (string) of each instance. So far, I have this (this code does not compile) : for(NSView *view in [self subviews]) { NSLog(@"class: %@ ", [view…
alecail
  • 3,993
  • 4
  • 33
  • 52
0
votes
2 answers

Get index of NSTextField completion

I have an NSTextField UI element where the user can type into the text field and I want to drop down a list of completions beneath the text field as a "live search". I was hoping to use the native text completions infrastructure, but when the user…
pjv
  • 566
  • 3
  • 16
0
votes
2 answers

Finding links in NSTextView with dynamic contents

I have an NStextView that loads a description from a JSON source. The NSTextView loads a different string every time the user clicks a button. These descriptions sometimes have a URL in them which is rendered as plain text and not as a clickable…
Max Steenbergen
  • 256
  • 1
  • 10
0
votes
1 answer

Handling mouse over on NSCell (NSTextAttachmentCell)

Can't figure out how to handle mouse move over NSCell (or NSTextAttachmentCell). Is it possible ?
dmitrynikolaev
  • 8,994
  • 4
  • 30
  • 45
0
votes
1 answer

nstextview change color some text

Hi i have a NS TexView: [risultato setString:[NSString…
Acunamatata
  • 55
  • 2
  • 9