Questions tagged [nstextfieldcell]
94 questions
53
votes
7 answers
Is there a "right" way to have NSTextFieldCell draw vertically centered text?
I have an NSTableView with several text columns. By default, the dataCell for these columns is an instance of Apple's NSTextFieldCell class, which does all kinds of wonderful things, but it draws text aligned with the top of the cell, and I want the…

e.James
- 116,942
- 41
- 177
- 214
22
votes
3 answers
NSTextField with shadow?
I'd like the NSTextFields I set up in Interface Builder to have shadows. I've implemented a way to do this which seems to work, but I'm not sure if it's the right way.
What I did is subclass NSTextFieldCell as follows and then set my subclass as the…

sam
- 3,399
- 4
- 36
- 51
18
votes
2 answers
NSControl's setCellClass is deprecated in OS X 10.10 what's the alternative for overriding NSTextField's cell class?
I'm attempting to follow the post linked below to override the NSCell of a NSTextField but it looks like the setCellClass method is now deprecated in OSX 10.10.
How to make NSTextField use custom subclass of NSTextFieldCell?
How should one override…

Camsoft
- 11,718
- 19
- 83
- 120
15
votes
2 answers
How to end editing in NSTextFieldCell inside NSOutlineView after ESC key is pressed
I'm trying to get a custom NSTextFieldCell (inside a NSOutlineView) to end editing when the ESC key is pressed but cannot find any way to accomplish this. I tried to add an observer for the NSControlTextDidChangeNotification-notification but it is…

finnsson
- 4,037
- 2
- 35
- 44
10
votes
2 answers
Invalid color System, labelColor (warning given only once)
I am getting following warning on OS X 10.9 console at the time of nib load(NSWindowController).
Invalid color System, labelColor (warning given only once)
I am using Xcode 6 and OS X 10.10 to compile my code. Most probably this warning is coming…

Parag Bafna
- 22,812
- 8
- 71
- 144
9
votes
3 answers
Cocoa NSTextField line spacing
I'm struggling with a very simple problem, I've several NSTextField ( I can't use NSTextView right now) and I need to change the line spacing of the displayed text.
What can I do to reduce row height or line spacing? Shrinking the font size isn't an…

SlowTree
- 1,275
- 1
- 10
- 19
9
votes
1 answer
No Setter method for assignment to property - cocoa application
I'm fairly new to objective-c and have just encountered an error i've not seen before.
I'm trying to set a Text Field cell as 'selectable', but i get the error "No Setter method 'setIsSelectable' for assignment to property."
Here are the .h and .m…

Steffan Davies
- 149
- 1
- 2
- 10
9
votes
3 answers
NSTextFieldCell vertical alignment, solutions seem to squash the horizontal alignment
I have a NSTextFieldCell that I wish to display with middle vertical alignment. Thanks to an older question here and a blog entry I have two working solutions.
However, both solutions seem to squash my ability to set the cell as right aligned. …

Bryan McLemore
- 6,438
- 1
- 26
- 30
8
votes
2 answers
How to customize the selected text colors of an NSTextField / NSTextView in an inactive state
I'm using an NSTextField and customizing the fieldEditor using the setupFieldEditorAttributes: method. This allows me to set custom foreground and background colors for the selected text, which is important because my textField has a black…

Michael Gorbach
- 534
- 2
- 4
8
votes
2 answers
What is the difference between NSTextField and NSTextFieldCell and to which do I bind?
More generally, what is the difference between control classes and control cell classes? Buttons have the same hierarchy, for example - NSButton and NSButtonCell.
Looking at the documentation for NSTextField bindings and NSTextFieldCell bindings,…

Matt
- 1,041
- 1
- 16
- 28
8
votes
1 answer
How to make NSTextFieldCell Accept Keyboard copy/paste(cmd+c / cmd+v)
I am writing an editable NSTextFieldCell in a NSTableColumn, and everything goes well. But I found that my cell can accept the mouse right click copy/paste while does not respond to the keyboard copy/paste (cmd+c / cmd+v). Could someone please tell…

Daniel Gao
- 293
- 2
- 7
7
votes
2 answers
How to make NSTextField use custom subclass of NSTextFieldCell?
I've been looking for a solution to make my NSTextField bottom-aligned and I've found this and adjusted it for my needs. So now I have this custom NSTextFieldCell but how do I tell my NSTextFields to use this class (programmatically)?

iMaddin
- 982
- 1
- 14
- 23
6
votes
2 answers
NSTextFieldCell with Multiple Lines
I need to show an NSTextFieldCell with multiple lines with different format on each line.
Something like this:
Line 1: Title
Line 2: Description
I subclassed NSTextFieldCell but I don't know how to go on with it.
Any ideas?

mikywan
- 1,495
- 1
- 19
- 38
6
votes
2 answers
Truncate the last line of multi-line NSTextField
I'm trying to create a text field similar to Finder's file labels. I would like the last (second) line to be truncated in the middle.
I started with a multi-line NSTextField.
However, calling [self.cell…

Mark
- 6,647
- 1
- 45
- 88
5
votes
1 answer
Adjust height of NSTextFieldCell dynamically based on text
Is there any way I can adjust the height of NSTextFieldCell in an NSTableView based on the amount of text in it?
In short, I want tableView:heightOfRow: to return a value according to the text in the corresponding NSTextFieldCell and keep updating…

lostInTransit
- 70,519
- 61
- 198
- 274