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

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

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
3 answers

Assigning text from a TextField to NSString in another Class

So I have a NSObject called Player Player.h @interface Player : NSObject{ NSString *PlayerName; } @property (nonatomic, retain, strong) NSString *PlayerName; Player.m @synthesize PlayerName; And then in my MainViewController.h #import…
Andyrewwer
  • 64
  • 9
0
votes
0 answers

NSTextField Troubles

I have a NSTextField in my MainMenu nib... The selector for this text field is connected to the AppDelegate. I have also set the action to be sent upon the end of editing. Like so... I have no idea why, but the action is only being sent when the…
0
votes
1 answer

Cocoa Bindings: NSStrings and NSTextFields?

I've managed to bind the value of an NSString to an NSTextField, but I wish to do the opposite. My goal is to be able to have an NSString that updates with a changing NSTextField.
Jesse
  • 26
  • 3
0
votes
1 answer

Subclassed text field and token field don't show cursor

If I subclass NSTokenField or NSTextField and override becomeFirstResponder (for the purpose of executing some code when the control becomes first responder), when the field becomes first responder (as indicated by the focus ring, and by logging)…
rdelmar
  • 103,982
  • 12
  • 207
  • 218
0
votes
1 answer

Unable to store background color of NSTextField set via InterfaceBuilder

I am trying to cache the background color set for an NSTextField via the Interface Builder in a member variable for later usage in another component. At startup, the background color of the NSTextField is set to transparent. @implementation…
JJD
  • 50,076
  • 60
  • 203
  • 339
0
votes
1 answer

Objective-c update NSTextField at ControllerView init

@interface TestViewController : NSViewController @property (nonatomic, retain) IBOutlet NSTextField *myLabel; - (IBAction)sendMessage:(NSButton *)sender; @end @implementation TestViewController @synthesize myLabel = _myLabel; - (id)init{ …
Constantin
  • 2,288
  • 2
  • 24
  • 31
0
votes
1 answer

Adding a basic login screen to a Mac application

I'm really new to Mac application building and I'm trying out some different techniques. I'm trying to figure out how to put in a basic login (username and password) screen into my app. In my method I currently have this, attempting to use the if…
haseo98
  • 837
  • 2
  • 10
  • 13
0
votes
0 answers

Get border size for NSTextField

I'm setting a NSTextField height based on the size of a text with a fixed width. If I set the NSTextField with no border, it gives me a correct measure. But if I changed the border style, it varies. Is there a way to get the border size, or better…
the Reverend
  • 12,305
  • 10
  • 66
  • 121
0
votes
1 answer

How to find the size occupied by the text in NSTextField?

I have a NSTextField(Label) in a NSView. Value in the label changes dynamically. I would like to set the Frame of the TextField always centered with respect to view.Is there any way to calculate the pixels or size occupied by the text in the…
Ram
  • 1,872
  • 5
  • 31
  • 54
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
1 answer

Why does NSDictionary change the value of when reading/writing to .plist

I am having an issue where NSDictionary is changing the values inside the tag when I read the file in from disk. It also changes it when I save it back to disk. I have a .plist file on disk that I read into a dictionary. This is the contents…
RGB World
  • 399
  • 1
  • 6
  • 19
0
votes
1 answer

Preferred method for text shadow in Cocoa

I have created a Mac app and need to place a shadow behind the white letters to better differentiate the text from the background. I noticed that I can use the "View Effects Inspector" in Interface Builder to add a drop shadow to static text. Is…
wigging
  • 8,492
  • 12
  • 75
  • 117
0
votes
1 answer

IBOutlets properties between two classes doesn't retain. Deallocated?

I'm trying to figure out why my NSTextFields are only retained in the first method sendVarsToButton but not in the updateTotal method. I need to access the values from the TextField set in the first method but I can't because it seems like my…