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
1
vote
0 answers
How to get title of NSButtonCell in delegate method of NSOutlineView
I am using NSButtonCell subclass to display checkbox , image and label in same cell. Now i want to edit label in outlineView on double click or on enter key.
NSButtonCell subclass:
- (void)dealloc {
[image release];
image = nil;
[super…

Parag Bafna
- 22,812
- 8
- 71
- 144
1
vote
0 answers
NSButtonCell when clicked disable other tablecolumn NSButtonCell
I have a NSTableView with two columns; A and B.
In column A and B there is a NSButtonCell (checkbox).
When I check the NSButtonCell checkbox in column A (value = 1) the NSButtonCell checkbox in column B should be disabled. When I uncheck the…

Shielden
- 11
- 1
1
vote
1 answer
How to deselect NSButtonCell in NSMatrix
I have two radio buttons in my NSMatrix with mode NSRadioModeMatrix. By default the 1st Radio button is clicked. My Problem is when i click on my Second Radio Button "Let me Choose" and click on Cancel , both radio buttons seems to be selected. I…

Zeus
- 571
- 1
- 7
- 23
1
vote
1 answer
NSMatrix with multiple toggle buttons?
I am trying to create an NSMatrix of NSButtonCells where between zero and four buttons can be selected (toggled on). I have tried the following (test) code, but am not sure how I can provide the functionality I require. Perhaps it's not possible…

trojanfoe
- 120,358
- 21
- 212
- 242
0
votes
1 answer
NSButton - Gray rectangle whenever the custom button is clicked
Can I just want to replace the appearance by setting a property of NSButton?
I am able to change the appearance by using the "image" property of the button but I got an ugly gray rectangle whenever the custom button is clicked (the image has a…

Quaso
- 373
- 1
- 6
- 18
0
votes
1 answer
IBAction for checkbox in NSTableView cell, unexpected sender
I have a cell-based NSTableView that includes a checkbox in the first column. Everything displays and seems to function correctly, except the handling of the checkbox action, which looked like so:
- (IBAction)ActiveCheckboxAction:(id)sender {
//…

johnpurlia
- 113
- 6
0
votes
1 answer
How do I extend NSButtonCell with a method in NSButton?
I am unfamiliar with the subclassing or extending Cocoa framework.
NSButton has a setToolTip method, however NSButtonCell does not. I rather not add new IBOutlets, so how can I accomplish this by accessing NSButton's method?
I have a series of…

Jon Weinraub
- 397
- 1
- 8
- 18
0
votes
1 answer
NSAttributedString size() method returns incorrect width
I created a custom NSButtonCell subclass which allows customizing padding between a button's contents. In my implementation (the full source code can be found on GitHub) I override titleRect(forBounds:) to position the button title:
var titleSize:…

József Vesza
- 4,775
- 3
- 27
- 42
0
votes
1 answer
Prevent NSButtonCell image from drawing outside of its containing NSScrollView
I have asked (and answered) a very similar question before. That question was able to be solved because I knew the dirtyRect, and thus, knew where I should draw the image. Now, I am seeing the same behavior with an subclassed NSButtonCell:
In my…

coneybeare
- 33,113
- 21
- 131
- 183
0
votes
0 answers
Setting background color of NSButtonCell
I am attempting to set the background colour of a checkbox within a tableview, but am struggling. currently I have subclassed NSButtonCell as follows:
import Cocoa
class MyCheckBox: NSButtonCell {
override init(textCell string: String) {
…

Brickers
- 182
- 1
- 12
0
votes
0 answers
NSButtonCell in NSCell-based NSTableView & Bindings
I have an NSButtonCell as data cell in one of my NSTableView's columns. The table view is cell-based and has two columns ; one with the button cell, one with a text field cell.
The button cell's respective column's target and argument are bound to…

Bruno Vandekerkhove
- 381
- 2
- 13
0
votes
0 answers
NSButton with title in different columns
I am doing a MacOs application and I would like to have a NSButton like this:
--------------------------
| text1 text2 |
--------------------------
I have been thinking and I don't find a solution to have both labels in the…

RuLoViC
- 825
- 7
- 23
0
votes
1 answer
Custom NSButtonCell black background
I have a NSButtonCell (a checkbox) in a cell-based NSTableView. I try to set its background color to a semi-transparent color (used tor the rest of the row), but this color fades to black. If the row color has an alpha of zero, the background of the…

berfis
- 417
- 4
- 17
0
votes
0 answers
How to set selected view of NSButton
I have an NSButton with a custom NSButtonCell. CustomButtonCell looks like:
#import "CustomButtonCell.h"
@implementation CustomButtonCell
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
CALayer *viewLayer = [CALayer…

Tom Shen
- 1,838
- 3
- 19
- 40
0
votes
1 answer
Showing image before text in NSButtonCell in NSMatrix
I am displaying buttons in NSMatrix.
My requirement is:
to change color of button title and
place an image at beginning of title, when certain condition is satisfied.
To do so, I used following code:
// setting attributed text
…

Devarshi
- 16,440
- 13
- 72
- 125