Questions tagged [nscell]

The NSCell class provides a mechanism for displaying text or images in an NSView object without the overhead of a full NSView subclass. It’s used heavily by most of the NSControl classes to implement their internal workings.

The NSCell class provides a mechanism for displaying text or images in an NSView () object without the overhead of a full NSView subclass. It’s used heavily by most of the NSControl () classes to implement their internal workings.

References:

115 questions
22
votes
10 answers

Is it possible to design NSCell subclasses in Interface Builder?

I'm trying to subclass NSCell for use in a NSTableView. The cell I want to create is fairly complicated so it would be very useful if I could design it in Interface Builder and then load the NSCell from a nib. Is this possible? How do I do it?
Benedict Cohen
10
votes
2 answers

NSButtonCell inside custom NSCell

in my cocoa application, I need a custom NSCell for an NSTableView. This NSCell subclass contains a custom NSButtonCell for handling a click (and two or three NSTextFieldCells for textual contents). You'll find a simplified example of my code…
Tobidobi
  • 390
  • 2
  • 8
9
votes
1 answer

Make NSSearchField use NSTokenFieldCell?

I'm trying to emulate the tokenized search feature of Mail.app and Finder.app on 10.7+ where there is what looks to be an NSSearchField with a search magnifying glass icon on the left and cancel (x) button on the right, but also includes tokens…
Andrew
  • 7,340
  • 3
  • 38
  • 47
8
votes
1 answer

In OS X 10.10, can I implement an NSControl without an NSCell?

I am learning about NSControl. I am aware that NSCell has begun its road to deprecation in OS X 10.10 Yosemite, and so I'd rather not use an API that is going away. Also, the NSControl Class Reference shows all cell accessors have been deprecated. I…
Ryan Ballantyne
  • 3,750
  • 3
  • 22
  • 26
7
votes
1 answer

How to detect active appearance for NSView or for its parent NSWindow?

All native controls have different appearance when their parent window is active or inactive. How should we check this state in custom components e.g. while rendering a button cell? We could inspect controlView.window’s properties like isMainWindow…
Vadim
  • 9,165
  • 7
  • 33
  • 58
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,465
  • 1
  • 19
  • 38
6
votes
1 answer

How to change height of NSSegmentedControl

I'm trying to increase the height of a NSSegmentedControl, beyond the 25px "Regular" control size. I subclassed NSSegmentedCell, I understand that i have 2 methods to work with. - (void)drawSegment:(NSInteger)segment …
Cory
  • 2,212
  • 17
  • 30
5
votes
1 answer

NSCell Custom Highlight

I'm trying to subclass NSCell to draw a custom background highlight. The documentation seems to suggest that the overriding highlight:withFrame:inView: should allow me to do this but the method is never called. Instead, I've overridden…
JoeR
  • 1,861
  • 3
  • 24
  • 38
5
votes
0 answers

NSComboBoxCell eats mouseUp events

I have an NSComboBox child of an NSPopover. The popover is transient and is configured to dismiss when the user clicks outside its bounds. When its combobox popup is active and displayed, and when the user mouses down on the popovers owning view,…
5
votes
2 answers

NSCell vs NSView: when many controls are needed

I am aware that Apple is deprecating the use of NSCell in favour of NSView (see AppKit 10.10 release notes). It was previously recommended that NSCell be used for performance reasons when many controls were needed. I have spent considerable time…
Sam
  • 2,407
  • 2
  • 14
  • 37
4
votes
5 answers

NSOutlineView Changing disclosure Image

I my outline view, i am adding Custom cell, To drawing custom cell, i am referring example code , present in the Cocoa documentation http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/ I want to change the disclosure image of the cell…
Amitg2k12
  • 3,723
  • 9
  • 45
  • 92
4
votes
0 answers

hitTest doesn't get called in NSCell subclass

I'm working on a subclass of NSCell for my project. This subclass has, in some situation a NSButtonCell drawn on its view, with this : - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { ... if (self.mode ==…
PofMagicfingers
  • 205
  • 2
  • 14
4
votes
1 answer

Make NSFormatter validate NSTextFieldCell continuously

In Cocoa, I have an NSOutlineView where the cells are NSTextFieldCell. The cell displays values which are strings that are formatted according to certain rules (such as floats or pairs of floats with a space in between). I have made a custom…
harms
  • 8,628
  • 4
  • 27
  • 27
4
votes
0 answers

NSCell KVO monitoring highlighted

I want to monitor the buttons cell highlighted state, but the callback gets never call, although the highlight changes monitoring the keyPath "state" works, but why doesn't monitoring highlighted? - (void)awakeFromNib { [super awakeFromNib]; …
Peter Lapisu
  • 18,394
  • 14
  • 107
  • 163
4
votes
3 answers

Exposing model object using bindings in custom NSCell of NSTableView

I am struggling trying to perform what I would think would be a relatively common task. I have an NSTableView that is bound to it's array via an NSArrayController. The array controller has it's content set to an NSMutableArray that contains one or…
1
2 3 4 5 6 7 8