The NSButtonCell class is a subclass of NSActionCell used to implement the user interfaces of push buttons, checkboxes (switches), and radio buttons. It can also be used for any other region of a view that’s designed to send a message to a target when clicked. The NSButton subclass of NSControl uses a single NSButtonCell.
Questions tagged [nsbuttoncell]
77 questions
2
votes
0 answers
How to create NSbutton inside an NSTextfield
In my application I need to show one label which showing the content and in the end of the label i need to show one button with close icon that will perform some action.
Can any one suggest way how to do this.

bhavesh
- 151
- 1
- 4
2
votes
2 answers
Programmatically created NSButtons won't press
My programmatically created buttons essentially aren't being pushed when I click them. Any idea why? Nothing happens, the action doesn't fire, the image doesn't change to the alternate image, etc.
(I'm using a MomentaryChangeButton but I've set it…

aroooo
- 4,726
- 8
- 47
- 81
2
votes
1 answer
NSTableView data source editing
I'm just a beginner in Cocoa developing for Snow Leopard and I have problem with editing values in data array that displayed in NSTableView.
I tried to edit some property of my object in -tableView:setObjectValue:forTableColumn:row: and I have…

nornad
- 41
- 1
- 6
1
vote
1 answer
Rounded NSImage corners in a NSButtonCell
I have a NSMatrix with a couple of NSButtons in it which have no Text but are only images. One of the images is downloaded from the internet and I would like to have it rounded corners in my OS X application.
I found one answer which nearly is what…

Jeena
- 2,172
- 3
- 27
- 46
1
vote
1 answer
setAction: Always Called with mouseUp
I have in my mac app an NSMatrix made up of NSButtonCells. I do this:
[matrix setAction:@selector(matrixbutton:)];
However this is always called when the user releases the mouse click. Is it possible to alter this so it is called as soon as the…

Josh Kahane
- 16,765
- 45
- 140
- 253
1
vote
2 answers
NSButtonCell subclass' button type not working
I subclassed the NSButtonCell class to give a different look to my button. I have the drawing code working fine. It's a rounded button filled with CGGradients to look like the iTunes playback controls. They are not completely the same, but they…

v1Axvw
- 3,054
- 3
- 26
- 40
1
vote
0 answers
NSButton state management
My NSButton is using custom NSButtonCell class, which in turn is overriding drawBezel:
override func drawBezel(withFrame frame: NSRect, in controlView: NSView) {
let path = NSBezierPath(bound: frame.insetBy(dx:…

Pablo
- 28,133
- 34
- 125
- 215
1
vote
1 answer
Getting checkboxes to reflect their state in an NSTableColumn
I'm making this program that has an NSTableView with four columns, two of which are make of checkboxes. I'm only trying to get one working right now and I've gotten stuck.
First, here's my relevant code:
-…

nintandrew
- 61
- 5
1
vote
2 answers
Custom NSButton and NSButtonCell
I'm trying to create a custom button look.
From what I've gathered, NSButtonCell does the drawing, so I should actually be overwriting that instead.
But the issue is, my CustomButton class has other things like NSImage, mIsMouseOver etc. Currently…

han
- 531
- 5
- 18
1
vote
1 answer
NSButton set background color macOS 10.12
I have NSButtons created in Storyboard that I would like to change the background color for. I have searched SO and Google but none of the solutions actually work on my project or even a simple test project. I've tried:
Setting the…

Tim
- 2,089
- 1
- 12
- 21
1
vote
3 answers
Getting Custom NSCell with NSButtonCell instance to handle mouse click/mouse events
OK I'm really stumped on this one. I want to make a checkbox with a
NSTextFieldCell combined together. It's important that the checkbox
goes ON if the mouse hits the box, NOT the text. I've accomplished
this, more or less, but the issue is receiving…

maz
- 8,056
- 4
- 26
- 25
1
vote
1 answer
NSButton tinting image in drawRect
I want to tint my button in drawRect, but cannot find the right setup to tint the image
- the button is borderless, with a grayscale image, which i want to tint
In my NSButton subclass :
- (void)drawRect:(NSRect)dirtyRect{
if ([self.cell…

Peter Lapisu
- 19,915
- 16
- 123
- 179
1
vote
1 answer
Unable to set background color of NSButtonCell for NSWindowController that uses an NSToolbar
I have successfully changed the background of NSButtonCells on most of my xib windows by using the following in windowDidLoad:
[[self.generalOkButton cell] setBackgroundColor:[NSColor blueColor]];
For some reason, when I try to do this in my…

valheru
- 2,552
- 3
- 20
- 40
1
vote
2 answers
Custom NSButtonCell, drawBezelWithFrame not called
I'm trying to figure out how to custom draw Buttons in Cocoa/OSX. Since my view is custom drawn I will not use IB and want to do it all in code. I created a subclass of NSButtonCell and a subclass of NSButton. In the Subclass of NSButtonCell I…
user99070
1
vote
2 answers
Binding BOOL value to NSArrayController
I have a tableview bound with array controller.There are two columns in table view,one is string and another one is BOOL.I am getting string values in tableview.For displaying BOOL values in NSButtonCell,I am facing problem.The button cell was…

Preethi
- 371
- 2
- 6
- 20