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

Constrain width of NSTextField in Interface Builder

I would like to use interface builder to display text in an NSTextField, which I can do. But when the text is too long to fit normally in the space provided in the interface builder layout, I need to be able to constrain in. I see the width…
Adam
  • 913
  • 1
  • 9
  • 26
0
votes
1 answer

Archived NSData, isEqualToData: and Empty Strings

I have a custom object containing several NSString objects, some ints and a few bools. I am using NSKeyedArchiver to archive a copy of the object into an NSData object. The user than makes changes to the object variables, which are connected to an…
Greg Steiner
  • 647
  • 1
  • 9
  • 20
0
votes
1 answer

setStringValue and pointers

I have a unique situation with setStringValue: and hoping someone could clear this up: Using the following theoretical example (not literal) code: NSString *myVar; [myOutlet setStringValue:myVar]; It appears that for any string value such…
Greg Steiner
  • 647
  • 1
  • 9
  • 20
0
votes
3 answers

How to use method in a view that i put controls on it from subclass of one of that controls

I subclass a NSTextField and in subclass use an event method (keyUp),i want to call a method in main view (view that i put NSTextFiled on it) when user push Enter key.i use below code but don't how to call specific method in main view -…
user437064
0
votes
2 answers

Delaying A Label Updated From Within connection:didReceiveData:data

I'm working on a download manager and I'm trying to update labels indicating the download speed and the percentage left. It updates way too fast within connection:didReceiveData though, and using a performSelector and delaying it from that method…
aroooo
  • 4,726
  • 8
  • 47
  • 81
0
votes
1 answer

How to achieve the recessed text style as in Apple's Messages for Mac?

I'd like to replicate the recessed text style of Messages/iMessage, or, the text "white-shadow" style on a light gray background. As you can see, the texts are with "white-shadow" even on the light gray background. The bold texts do have subpixel…
Thruth
  • 13
  • 4
0
votes
1 answer

Show variable inside text field label

In my Cocoa application I show the result of a calculation in a NSTextView, now I wish you could see the result in a NSextField, I tried in every way but did not succeed. [textField insertText:[NSString stringWithFormat:@"%i \n", giorni]];
Andrea
  • 427
  • 3
  • 16
0
votes
1 answer

Embedding a field editor in a NSScrollView

Has anyone ever had experience embedding a field editor (for a NSTextField) inside a scroll view? I'm trying to make the NSTextField scrollable while editing. Things I've tried: Dynamically embed it when the custom field editor's…
Vervious
  • 5,559
  • 3
  • 38
  • 57
0
votes
1 answer

NSCell -stringValue calls -setStringValue?

In essence, here is my code in a subclass of NSTextFieldCell: - (void)setStringValue:(NSString *)aString { [super setStringValue:aString]; [self doSomething]; } - (void)doSomething { NSLog(@"%@", [self stringValue]); } In essence, I'm…
Vervious
  • 5,559
  • 3
  • 38
  • 57
-1
votes
1 answer

NSTableView: Directly editing a textfield without highlighting the whole row

I have a NSTextfield in a TableView. The content mode is configured to ViewBased. So I have the type: NSTableCellView. Example of my Table View: My problem is that I can't edit until I have selected the line. However, I want to click on the text…
Fatih
  • 3
  • 2
-1
votes
1 answer

NSTextField: error on calling completions by .complete(nil) in swift 5

I'm using NSTextField with complections and they work fine by pressing F5 key. But I have to call complections programmatically and I'm using complete(:) for this, but I get an error and crash every time I I tried to call…
-1
votes
1 answer

Swift macOS label Gradient Text

I have a label in a macOS project which when connected becomes an NSTextField. I want to make the text have a gradient overlay. I have some code to do this with an iOS UIButton, but for this project I keep getting the error that NSView has no such…
Levi K
  • 573
  • 1
  • 4
  • 23
-1
votes
1 answer

Why does controlTextDidChange(_ obj: Notification) not work for label ? [macOS]

Why does controlTextDidChange(_ obj: Notification) not work for label ?. I want a function to be called when the stringValue of the label changes [macOS]
Prithvi Venu
  • 264
  • 3
  • 16
-1
votes
1 answer

Looking for example of how to display text in an NSWindow programmatically?

I am trying to display text in a HUD style semi-transparent window. I have got the code for the window all set up, but I have been scouring the documents for two days now and haven't come up with a way that works to actually display text in the…
Chris Norman
  • 225
  • 2
  • 11
-1
votes
1 answer

Label won't copy Text as typing - tried many solutions (MacOS app)

I'm new to coding and about to tear my hair out. I have a split view set up (macOS app) and I'm just trying to get a label on the left hand side to update to text entered on the right as the user is typing. I’ve been struggling for around 15+ hours…