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
1 answer

Trying to append a string to another string from a NSTextField for printing on a PDF file

I have a method that saves the customer data entered in on the form that calls a method to createPDFFile. I have the PDF file created and I have some filler strings in there currently so that I could lay out the PDF file and I now want to take the…
Beanno1116
  • 239
  • 2
  • 3
  • 10
0
votes
1 answer

NSTextFieldCell draws white background only when not the first responder

I have two NSTextFields in a storyboard, both remain untouched from the default configuration, except I have changed their classes to a subclass. I've also subclassed the inner NSTextFieldCell. I've customized each as desired - pretty simple…
Jordan H
  • 52,571
  • 37
  • 201
  • 351
0
votes
1 answer

Adjust NSTextField content size based on the string value

In my project I am using NSTextField. As my application supports multiple languages, The same text field may have different text lengths according to various languages. Is there any option to solve this using auto lay out, setting constraints, or is…
Govind
  • 2,337
  • 33
  • 43
0
votes
1 answer

NSTextField placeholder text doesn't show unless editing ,What should I do?

(Editing) (Not Editing) I have Subclass NSTextFieldCell and then override this method: -(void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { NSRect customRect = cellFrame; customRect.origin.y = cellFrame.size.height -…
0
votes
2 answers

Rounded NSTextField draws with transparent corners?

My NSTextField has rounded corners and a white background color, but it seems as though the view itself is rectangular. This means the space between the rounded corners and the bounding rectangle are showing as transparent. How can I fill in this…
user3225395
  • 581
  • 6
  • 23
0
votes
0 answers

Cocoa / Core Animation: everything jumps around upon becomeFirstResponder()

The gist: I have a bunch of views nested in one MainView. When I call becomeFirstResponder() on an NSTextField that's nested in one of those views, suddenly every view within MainView jumps to a semi-arbitrary older position. The actual cause could…
issa marie tseng
  • 3,194
  • 22
  • 20
0
votes
2 answers

Detect paste operation on NSTextField in Swift

I want to configure some text before 'fully pasting' it into an NSTextField. Is there an (easy) way to detect if the user is pasting text rather than writing it into a NSTextField in Swift?
power_N_9
  • 35
  • 1
  • 6
0
votes
1 answer

Load link in NSTextField in a WKWebView

I have an NSAttributedString which has multiple links (with NSLinkAttributeName) in it. Clicking on the link, launches the web browser, and loads the page. Instead, I would like to intercept it and show the link in a webview in my application…
georgemp
  • 716
  • 10
  • 21
0
votes
2 answers

Spelling suggestions in NSTextField

My app has NSTextFields for input; I purposely do not use NSNumberFormatter in order to do special handling of input. The app implements "full screen" mode. When the app is in full screen, and the focus is in a text field, and I press the ESC key to…
wagill
  • 57
  • 6
0
votes
1 answer

Reuse a value from NSSlider in variable

I have a little problem but I can't figured out ... I code a sort a Shutdown countdown and I need to re-use the variable name "x" in the following code : @IBAction func valueChange(sender: NSSlider) { let x = sender.intValue …
Pablo Clsn
  • 13
  • 1
  • 6
0
votes
1 answer

How to change insertion text (cursor) for NStextField? for os x swift 2

the most relevant code i found was let fieldEditor = self.window?.fieldEditor(true, forObject: textField) as! NSTextView? fieldEditor!.insertionPointColor = NSColor.redColor() but doesn't work because field editor is nil i tried this using in…
fahad khan
  • 89
  • 1
  • 6
0
votes
0 answers

With Swift on OS X, how to have controlTextDidChange() to don't block entering more than a digit in a NStextField?

I'm trying to use controlTextDidChange() in a NStextField with currency formatter under OS X to hide a labelField when user modify the content of the NSTextField. Unfortunately when I try to use it, the NStextFiedl accepts only a change and then…
Cue
  • 2,952
  • 3
  • 33
  • 54
0
votes
2 answers

Objective-C - Call a method that modify a textField from another class

I have two questions : When I try to call a method from different class (this method modify a textfield after having checked a condition) the method is well called (the NSLog in statutInternet works) but the TextField isn't modified.. When I do it…
Alexandre
  • 38
  • 6
0
votes
1 answer

NSTextField not noticing lost focus on NSWindow close

I have several NSTextField that are used on a dialog created as an NSWindow and which is displayed via: [NSApp runModalForWindow:dialog] My problem is that if a user clicks in the NSTextField, edits the value and then clicks the dialogs DONE button…
Cliff Ribaudo
  • 8,932
  • 2
  • 55
  • 78
0
votes
0 answers

Changing editability of NSTextfield and multi line text

I have an NSTextField that is used as either a label or an editable text field depending on whether the application is in edit mode or in view mode. The code to change the editability of the text field is: var editable : Bool = false { didSet…
Dieudonné
  • 543
  • 1
  • 4
  • 16