nstextfield

Core Animation Unwanted Text Sharpening.

Whenever I add a layer for Core Animation either from the nib or programatically, the NSTextFields (labels) in my interface get messed up. Here's a screenshot from Apple's BasicCocoaAnimations example. (Look at the text fields on the left, somehow they're drawn sharper than normal) Note that if I add a layer in IB then it also gets mess...

Where is NSTextfield Validates Immediately?

I have set it before but I cannot find the option any more... ...

using a custom nstextfieldcell in an nstextfield

I have a custom nstextfieldcell. I thought I could drag a textfield to a xib and click on it's cell, then change the cell's class to my custom class.That doesn't work. Also, I thought I could drag the custom cell from the library (i made a plugin) over the textfield and it would set the new cell like in a table. That doesn't work eithe...

Trying to create link with NSTextField

I'm using this category (is that right?) http://www.nightproductions.net/references/dsclickableurltextfield_reference.html#setAttributedStringValue to implement clickable textfields. I've imported the header file in my controller class and set it's attributed string value like this NSAttributedString* str = [[NSAttributedString alloc] ...

Subclassing NSTextField to create a number dialing text field

Hi, I am trying to create a number dialing text field, that is, a text field that works in conjunction with an NSStepper sitting next to it. The text field should display floats and allow the user to use the scroll wheel to adjust the number it is displaying as well as the up and down arrow keys to the same effect. It should also swit...

How does an NSTextField know that it's value has changed?

I have a textfield that can either be edited by hand, or set through another control. (It's a page number, so you can jump to page 16 by typing in 16, or you can page up and down with the next/prev buttons) I have the value of the text field bound to an int page variable. It seems to work correctly, when you type a page number in, it ju...

NSTextField enter to trigger action

I've been looking all over for a simple example of how to have an action (or button) be triggered when the enter key is hit in the text field. Should I subclass the text field? Would I need to set a delegate to call the action I need? Is there a way to catch the event in my main window controller class? If you could even just point me ...

Dragging an NSTextField inside of a window

Hello, Im attempting to make a little app that lets you add text boxes to you canvas (window). I have an NSTextField that needs to let you drag it around the window. When you drop it it needs to stay in the spot you mouse left it. Heres my code to make the fist text field: NSTextField *myTextField=[[NSTextField alloc] initWithFrame:NS...

How do I send the mutable string to the NSTextField properly?

So I have all this code that I have debugged and it seems to be fine. I made a mutable string and for some reason I can not get it to be displayed on my label. the debugger says "2010-04-22 22:50:26.126 Fibonacci[24836:10b] * -[NSTextField setString:]: unrecognized selector sent to instance 0x130150" What is wrong with this? When I ju...

how to get NSTextField in custom NSFormatter class

i am new to cocoa and objective-c and creating small application having few NStextFields on the window.I have create custom NSformatter to validate the inputs,at some instance i want to get the NStextField within my custom NSformatter to change its backcolor to red to notify user for wrong input value.I didn't getting how to get the curr...

How do I enable spell checking within an NSTextField on Mac OS X?

I have an NSTextField that I would like to enable "as-you-type" spell checking. When I load my application I can do this from the Menu Bar > Edit > Spelling and Grammar > Check Spelling While Typing. I would like this option to be enabled by default. Within IB I can enable this for a NSTextView but I would like to use NSTextField for ...

How do you set the text in an NSTextField?

I'm trying to set the text in an NSTextField, but the -setStringValue: and -setTitleWithMnemonic: methods are not working. Any ideas? Rgds / a² ...

Get NSTextField contents to scale

How can I have the text scale to fit the bounds I gave it? ...

NSTextField (Label) Attributed Text: Select

I have a NSTextField Label that has attributed text in it. The color and size are different from the defaults. (The text is a bit larger and green) Now, I need to be able to select the text in the label so as the click the hyperlinks embedded in the attributed text. This works fine; however, when selecting the text the format of the text...

How to remove cursor from text field on click of button?

Hi all, I am trying to do a simple task: I have an editable text field, two buttons (titles: make editable/ make un-editable) over a window. Idea is: when user clicks "make editable" button, text field should become editable and when he/she clicks "make un-editable", it should become un-editable. In action of "make un-editable" I am ...

How to add data from an NSTextField to a Core Data Attribute without having to press Return or Tab after editing the TextField?

I use a sheet with 3 NSTextFields and a Cancel- and OK-Button to edit the attributes of a Core Data Entity. The text entered in the NSTextFields is only updated in the Core Data Entity if i press Tab or Return after writing in the NSTextField or if i focus another NSTextField with the mouse. If i just enter text in an NSTextField and pre...

how to show avg of employees salary in a NSTextField using NSArrayController and cocoa bindings

Hi all, I am new to cocoa bindings so I tried to make a simple application which will simply calculate avg of employees salary and display it in a text field, using cocoa bindings. I followed these steps: Made the model class : Person with one property for now - @property (readwrite, assign) int salary; In the application delegate cl...

Concatenating a string with the value of a NSTextField results in odd symbols in Objective-C

I'm in my second day of learning Objective-C, Cocoa and IB. This is probably something really simple but I cannot work it out. Basically, I have a form with a NSTextField, when the user types in this field and clicks an OK button the application will display an alert saying Hello followed by the value of text field. It's all working ap...

Subclassing an NSTextField

Given all the complex things I seem to cover every day, this appears to be a "what the heck am I doing wrong that seems to simple?" scenario! I would like to subclass an NSTextField to change the background color and text color. For simplicity sake (and to help anyone who hasn't ever subclassed anything before), here is the example of m...

Faking an NSTextField using an NSTextView to get nice coloring?

Trying to change the selected text background color for an NSTextField (we have a dark UI, and selected text background is almost the same as the text itself), but only NSTextView seems to allow us to change this. So we're trying to fake an NSTextField using an NSTextView, but can't get text scrolling to work the same. The closest we g...