Questions tagged [nstextfieldcell]
94 questions
5
votes
6 answers
How do I set the font size in a text cell so that the string fills the cell's rect?
I have a view that contains two NSTextFieldCells. The size at which these cells are drawn is derived from the size of the view, and I want the text in each cell to be the largest that will fit in the derived size of the cell. Here's what I have,…
user23743
4
votes
0 answers
Top padding in NSTableView Cell
I want to add some space from top in NSTextFieldCell, I have searched , i found there is way with subclassing. But by this way my touch event for table doesn't work. if i use TextFieldCell's touch events then also i can't find real data according to…

Ishu
- 12,797
- 5
- 35
- 51
4
votes
3 answers
NSOutlineView with badge of unread messages like Mail.app
I'm trying to create a user interface similar to the iTunes source list or the Mail.app mailbox list where a badge with a number (e.g. unread emails, new podcasts) is shown at the right hand side of an element.
Based on Apple's SourceList example, I…

Mark
- 1,447
- 2
- 14
- 26
4
votes
1 answer
Swift: Add Action to a Table View Cell when value entered
I have a Table View Cell and have added an action to it that I want to execute when a value is changed.
I have added the action method in the viewController
@IBAction func valueEntered(sender: NSTextFieldCell)
{
print("valueEntered")
}
I can…

iphaaw
- 6,764
- 11
- 58
- 83
4
votes
2 answers
Setting the cell on NSTextField
I have a custom NSTextFieldCell that i want to set on a NSTextField.
If i set it on the IB it works fine.
And this gets it working like this:
But i want to set it programmatically and i try something like this:
-(void)awakeFromNib{
NSRect…

ozmax
- 470
- 6
- 17
3
votes
1 answer
How to create a NSTextFieldCell, that in edit mode displays a custom view instead of NSTextField?
I have a tableView, with 3 columns containing NSTextFieldCell. Everything is populated with bindings.
The text of the cells of one of the column is computed and is not editable directly.
For this column, I would like when the cell goes into edit…

Guillaume
- 21,685
- 6
- 63
- 95
3
votes
3 answers
Cocoa: how to implement a custom NSView with an editable text area?
What's the minimum implementation needed to make a custom NSView with an editable text area? I assume NSTextFieldCell can be used for this. I've succeeded in drawing the cell in the view (which is straightforward), but making it editable seems to…

Rinzwind
- 1,173
- 11
- 23
3
votes
1 answer
How can I get "Select All" working in my subclassed NSTextField/NSTextFieldCell?
Generally, when editing text in a text field/input/area/editor, pressing ⌘A will select all of the current text in said field/input/area/editor. I've subclassed NSTextField and NSTextFieldCell, and no matter what I try, I can't seem to get basic…

Ben Stock
- 1,986
- 1
- 22
- 30
3
votes
2 answers
NSTextField Inner Shadow
I am trying to get a inner shadow on a label in my Mac app.
I am trying to match the Photoshop design my designer sent over.
The look I am trying to match is:
The way this is being done in Photoshop is by setting an inner shadow with the following…

kdbdallas
- 4,513
- 10
- 38
- 53
3
votes
1 answer
NSTextField bottom-aligned
I need to bottom align the text in my NSTextField so that the bottom pixel rows of my text always stays in the same spot when dynamically changing the font size (I use this to do that).
Right now I have this scenario: whenever the font size gets…

iMaddin
- 982
- 1
- 14
- 23
3
votes
1 answer
Is it necessary to implement all initializers for NSTextFieldCell subclass?
As per the docs, I have created a custom subclass of NSTextFieldCell with the sole purpose of overriding the method setUpFieldEditorAttributes:.
The docs don't mention any initializers for NSTextFieldCell's or its super class NSActionCell, but the…

Monolo
- 18,205
- 17
- 69
- 103
2
votes
1 answer
Adding an editable NSTextFieldCell to my NSTableView
I have an NSTableView which displays some information representing a custom object of mine. I am not using bindings.
Typically, I create my own NSCells to display data, but for once I'm after an NSTextFieldCell that will display a string value of…

Ricky
- 3,101
- 1
- 25
- 33
2
votes
1 answer
What is the easiest way to custom NSTableView cell?
I'm an iOS developer. I recently started my Mac project, but I found that unlike UITableViewCell, which is a subclass of UIView, the cell of NSTableView is NSCell, and I even can't create it in IB. I wonder if there are some easy ways to create…

nonamelive
- 6,510
- 8
- 40
- 47
2
votes
0 answers
How to change the height of a NSTextField?
I am trying to change the height of a NSTextField for a macOS application.
How can I change the height of my NSTextField and have the text centered vertically like a normal UITextField on iOS. I added a height constraint to try and make it bigger…

samuscarella
- 89
- 2
- 9
2
votes
1 answer
How to call NSCell's fieldEditorForView: to assign custom field editor
I have an NSTextView, which I want to use as the field editor of an NSTextField.
Since there will be other NSTextFields in the view that do not use a custom field editor, it seems I should use NSCell's method
- (NSTextView…

lulu
- 669
- 10
- 26