Questions tagged [nstextfield]

NSTextField object belongs to Apple's class. It's a kind of NSControl that displays text that the user can edit or select.

An NSTextField object is a kind of NSControl () that displays text that the user can select or edit and that sends its action message to its target when the user presses the Return key while editing.

The NSTextField () class uses the NSTextFieldCell () class to implement its user interface.

References:

1028 questions
0
votes
0 answers

How to add a NSTextField to the subview of another NSTextField

I have seen an app on OSX that show as below: And i can see the control structure by the UIElementInspect tool. From the screenshot, we can see that there is a big NSTextField, and it has so many small sub NSTextField, each sub NSTextField can be…
jimwan
  • 1,086
  • 2
  • 24
  • 39
0
votes
1 answer

Label/Text in Xcode Appears Blurry

I am trying to make a preferences view with lots of text. I cannot figure out why the text is blurry when i run the project, even though the interface builder is very sharp and clear. Here is a picture. [1]: https://i.stack.imgur.com/EQl6D.png here…
Bolt Sandwich
  • 65
  • 1
  • 6
0
votes
1 answer

Unable to focus on NSTextFields from Modal window

I currently have a window open which was opened via: // FirstWindowController [self showWindow:self]; [[self window] makeKeyAndOrderFront:self]; [NSApp runModalForWindow:[self window]]; And upon click of a button I'd like to hide…
Geesu
  • 5,928
  • 11
  • 43
  • 72
0
votes
1 answer

Making NSTextField not shrink when NSLineBreakByTruncatingTail is set

The NSTextField shrinks slightly if NSLineBreakByTruncatingTail is set as the line break mode without adding ellipses. Can this be prevented somehow? In iOS you can do this but I can't find a way on the Mac.
strangetimes
  • 4,953
  • 1
  • 34
  • 62
0
votes
1 answer

NSTextField Subclass Crashes on setLineBreakMode: method

I have a subclass of NSTextField and I setting the LineBreakMode. It works fine under my mac with Yosemite and Crashes for one of my users on Mavericks Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[XTextField…
Coldsteel48
  • 3,482
  • 4
  • 26
  • 43
0
votes
1 answer

Cocoa - Multiple NSControls working but not NSTextFields

I am new to using interface builder, and am building for Mac OS X. I have a NSTableView in my main window, the NSTableCellView subclasses of which each have their own set of controls. All of these controls (there are sliders, buttons, etc.) work…
Stuart Barth
  • 301
  • 2
  • 10
0
votes
1 answer

Converting an NSComboBox to and NSTextField Easily

I have an NSComboBox and I was wondering if there is an easy way to convert it to an ordinary NSTextField? Considering NSCombBox is a subclass of NSTextField, I would think there is an easy way to turn this on/off but I can't figure it out.
mac2017
  • 445
  • 1
  • 6
  • 16
0
votes
1 answer

NSScrollView with several TextFields

I'm trying to create simple application (for testing purpose) with NSScrollView and 2 multi-line labels inside it (title and document). I can't use integrated TextView because I need 1 general scroller to scroll all content, not just for one…
Vasily
  • 3,740
  • 3
  • 27
  • 61
0
votes
2 answers

How to get NSNumberFormatter to allow hyphens?

I have an NSTextField with an NSNumberFormatter to limit entry to numbers, but it will not allow me to type a hyphen to enter a negative number (even after setting "minimum" to "-1,000"). I can copy/paste a "-1" into the field and programmatically…
Marc Fearby
  • 1,305
  • 1
  • 13
  • 28
0
votes
2 answers

Communicating between subclassed nstextfield and view controller in swift

I've run into an issue where I need to communicate between a class that is a subclass of nstextfield and the view controller I am using in a cocoa swift project. The subclassed nstextfield changes the size of it's frame. The field itself is within a…
user3932488
  • 139
  • 1
  • 9
0
votes
1 answer

Execute callback when text changes inside a NSTextField in Swift

I have a NSTextField and I would like to execute a callback whenever the text inside it changes. The callback would be to enable a disabled "save" button at the bottom of the form. What I managed to do so far is sub-class NSTextView in order to…
beeb
  • 1,187
  • 11
  • 32
0
votes
1 answer

Can't change NSTextField's string value in other classes than the AppDelegate

I'm working on an Mac OS X app that'll save and load data (sort of notes app). I've added some NSTextFields and I want to change its string value when the load button is pressed. I want to do that in a separate class. I created the class and called…
Developer
  • 406
  • 1
  • 4
  • 18
0
votes
2 answers

Calculate height of the text container

In order to display views in NSTableView I have to calculate of text in NSTextField. I'm using this method: float heightForStringDrawing(NSString *myString, NSFont *myFont,float myWidth) { NSTextStorage *textStorage = [[NSTextStorage alloc]…
PawelPawel
  • 77
  • 1
  • 10
0
votes
2 answers

NSTextField Autocomplete / Suggestions

Since some days I am trying to code an autocompletion for a NSTextField. The autocompletion should look that way, that when the user clicks on the NSTextfield a list should be displayed under the TextField which possibilities are available. After…
Robby
  • 23
  • 8
0
votes
0 answers

Set NSTextField frame height in tableView viewForTableColumn not working

I have a .xib with 2-3 NSTextFields displayed in it (as shown below). I would like to resize one of these NSTextFields so it best fits the content it is displaying. My problem is that I cannot change the size of the Text Field in the…
iphaaw
  • 6,764
  • 11
  • 58
  • 83