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
1
vote
1 answer

Change background of NSCell without changing all cells in the NSTableColumn

I'm trying to change the background of a specific cell in a cell-based NSTableView. However, when I try to change the background color of just one cell, it affects the entire column. Is there a way to separate whatever binding there must be between…
1
vote
1 answer

Mouse tracking with modifier keys in table view cell

I have a NSTextFieldCell in a column of a cell-based NSTableView. This cell should handle clicks. This works fine when no modifier keys are pressed. If I hold the shift or command keys, the table view swallows the mouseDown event in an attempt to…
Pierre Bernard
  • 3,148
  • 2
  • 23
  • 31
1
vote
2 answers

Detect start of cell editing in cell-based NSTableView

I have some editable cells in an NSTableView. I enter a cell by double clicking on it. I have other buttons on the window. Any time I click on a button, this terminates the cell editing in a way I just get nothing in the cell and the NSTableView is…
1
vote
1 answer

NSTableHeaderCell detect mouse down?

I'm attempting to customize a NSTableHeaderCell to detect mouse clicks. In the past i've used things such as an NSTrackingArea or overriding the mouseDown event such as: -(void)mouseDown:(NSEvent *)theEvent { NSLog(@"Mouse down"); } These…
Kyle
  • 17,317
  • 32
  • 140
  • 246
1
vote
2 answers

Flipped NSImage in the NSCell

Why NSImage drawn flipped in the NSCell of NSTableView. And how proper fix that behavior. I returns image from the data source method: - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row…
toohtik
  • 1,892
  • 11
  • 27
1
vote
1 answer

How to set background color of cell with NSButtoncell type in NSTableView?

This is my table view delegate: - (void)tableView:(NSTableView *)tableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)tableColumn row:(int)row { id theRecord; NSMutableString *gid; theRecord = [tableDataSource…
Irwan
  • 783
  • 1
  • 13
  • 28
1
vote
1 answer

NSSliderCell: subclass to draw custom knob

I need to subclass NSSliderCell to customise its appearance. I had no problem with the bar, I overrode - (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped and it works as expected. - (void)drawKnob:(NSRect)knobRect works as well, but I want…
Alessandro
  • 61
  • 1
  • 8
1
vote
2 answers

Intercept Keydown Actions in an NSTextFieldCell

I have a cell-based NSOutlineView which displays NSTextFieldCell objects. I'd like to respond to keydown or keyup events so as to make the text contained in the NSTextFieldCell bold when the text contains certain preset keywords. What is the most…
VikR
  • 4,818
  • 8
  • 51
  • 96
1
vote
1 answer

-(BOOL)trackMouse:inRect:ofView:untilMouseUp: Is never invoked

I have subclassed NSControl to get my custom control, have subclassed NSCell to get my custom cell, over overridden -(BOOL)trackMouse:inRect:ofView:untilMouseUp and necessary methods in custom cell, have overridden +…
Suhas Aithal
  • 842
  • 8
  • 20
1
vote
1 answer

How to change the focus ring color?

In the draw function of the NSImageView,I want to set my custom focus ring color,not the default blue color.I tried as follows code NSSetFocusRingStyle(NSFocusRingOnly); [[NSColor redColor] setStroke]; NSRectFill([self bounds]); But the color is…
gohamgx
  • 273
  • 2
  • 16
1
vote
0 answers

Proper NSActionCell programming

I'm having trouble finding information about custom controls and cells. My control should have multiple NSCells, which is why I can't use the default NSControl. The Cell is being displayed correctly. However, they are NSButtonCells, and should…
IluTov
  • 6,807
  • 6
  • 41
  • 103
1
vote
1 answer

NSControl and NSCell: Manage the cell state the right way

I have a totally custom NSControl with its totally custom NSCell. Now I want to implement some Mouse interaction. For example when user clicks over the control I want to change the control state to highlight so the questions are: 1) Where I have…
MatterGoal
  • 16,038
  • 19
  • 109
  • 186
0
votes
1 answer

Expand an NSCell when multiples lines

I'd like to have the same behaviour that Console.app in 10.7. Lines that are truncated come with a disclosure triangle A click on the triangle / a double click on the line / press on "Right Array" expand the NSCell and show the whole text I was on…
Tom
  • 613
  • 6
  • 14
0
votes
2 answers

Getting the column and row of an NSCell in an NSMatrix in Cocoa

Given an NSMatrix and an NSCell is there a quick way to query the matrix to know at which row and column in the matrix the cell is placed. I would like to know this upon receiving action messages from NSActionCells. The only way I can see of doing…
jbat100
  • 16,757
  • 4
  • 45
  • 70
0
votes
1 answer

TableViewCell doesn't update correctly

I have this tableviewcell.m to configure my cells. It is configuring the text and information correctly but I just can't get it to update the color according to some other information. Here's the code: -…
Farini
  • 923
  • 1
  • 18
  • 35