Questions tagged [nsbuttoncell]

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.

77 questions
3
votes
0 answers

Custom NSButtonCell rendering and default buttons

I've recently come across a problem with a custom NSButtonCell subclass. We have a dark interface with white text, and all is going as expected, until we try to make a default button (i.e. assigning a key equivalent of \r). What we get seems…
Siobhán
  • 1,451
  • 10
  • 9
3
votes
1 answer

NSPopUpButton with InlineButton style logs "Unknown bezel style 15 and/or control size 1"

I have an NSPopUpButton with Inline Button style. When mouse enters, exits or mouse down or mouse up, it logs "Unknown bezel style 15 and/or control size 1" 15 is the NSInlineButtonStyle from NSButtonCell.h typedef NS_ENUM(NSUInteger, NSBezelStyle)…
uchuugaka
  • 12,679
  • 6
  • 37
  • 55
3
votes
0 answers

NSButton with image does not show up when disabled

I have created an NSButton that uses an image only and no text. I create the button using the following code. The code is called from the containing window's awakeFromNib. [[self contentView] addSubview:closeButton]; [[closeButton cell]…
Brad S
  • 585
  • 3
  • 12
3
votes
1 answer

NSPushOnPushOffButton Not Staying "Pushed In"

I'm trying to add a button to a view programmatically and I'd like it to stay "pushed in" when clicked, until it is clicked again. From what I've read it seems like the button to use for this would be NSPushOnPushOffButton. Here's Apple's…
Matt Cooper
  • 2,042
  • 27
  • 43
3
votes
2 answers

How to set background color while selecting row of NSOutlineView

I am having a big problem and not able to solve it. I have an NSOutlineView which contains a NSButtonCell which is bound to arrayController from there it is setting its Title and based on some value an Image is set in the cell background by…
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140
3
votes
1 answer

How to Get state of NSButton (CheckBox) from NSMatrix

Why my code changes the state of selected NSButtenCell to NSOnState after first run? NSButtonCell *b=[[NSButtonCell alloc] init]; b=[self.myMatrix selectedCell]; [self.myMatrix selectCellAtRow:0 column:0]; if (b.state == NSOnState) { …
Sajad Garshasbi
  • 508
  • 1
  • 9
  • 23
3
votes
0 answers

Get highlighted state for NSButtonCell

I have a NSTableView that contains a NSButtonCell in one of the columns. To draw a custom background in neighbor cells (based on NSTextFieldCell) I use isHighlighted method: - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { …
andv
  • 23
  • 1
  • 6
3
votes
2 answers

NSButtonCell hover image, transparent background on click?

I've implemented an NSButton with an image in it. When the user hovers it, the image changes to something else, and then back on. Normal Status : On Hover : The code I'm using for the NSButtonCell is : Interface : #import…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223
2
votes
1 answer

NSButtonCell of Check type within NSTableView does not allow to have value changed

I have window with 3 table views (10.7.2, Xcode 4.2). They are all created in IB and NSButtonCells are connected with outlets. I created controller class and I filled all three views with some sample data: -…
mbpro
  • 2,460
  • 3
  • 22
  • 37
2
votes
1 answer

Avoiding making a NSButton transparent / see-through when isEnabled is false (disabled)

A regular NSButton seems to be transparent if it’s disabled. Image shows a Button with style 'push' However, I want to disable the Button without the transparency. I’ve tried to programmatically set the alphaValue to 1.0 but it seems that the…
ixany
  • 5,433
  • 9
  • 41
  • 65
2
votes
2 answers

How to add tooltips to NSButtonCell that is within a NSMatrix

I am currently instantiating an NSMatrix w/ NSButtonCell subclasses through IB I use the identity inspector to change the Tool Tip property But the tooltip doesn't show on the button cell. If I set a tooltip on the NSMatrix object, a tooltip still…
A O
  • 5,516
  • 3
  • 33
  • 68
2
votes
0 answers

What secret things are happening to my NSButtonCell?

I'm writing an OS X app (target 10.10, Xcode 6.1) and I'm really confused by my custom NSButtonCell subclass. It seems like there are things going on here that shouldn't. I'm new to OS X programming, so I'm asking if anyone has insight into the…
Spencer Williams
  • 902
  • 8
  • 26
2
votes
1 answer

NSButton subclass to change button image

I subclassed NSButton so that the button image would change when it is clicked. The following code is used for the subclass. #import "MyImageButton2.h" @interface MyImageButton2 () @property (strong, nonatomic) NSCursor…
wigging
  • 8,492
  • 12
  • 75
  • 117
2
votes
1 answer

Checkbox on table column won't register click

I've a table view to which I add columns dynamically. It must be done this way because I can't predict how many or which columns I will need. Some columns are checkboxes but I can't click on them when I run my application. The column and checkbox…
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
2
votes
1 answer

Get hover event over NSButton to show an image

So I am trying to make an application that has a button (doesn't have to be a button) that when you hover over it a pop-up window appears. I have been able to print a message to the log when i hover over the button, but I can't figure out how to set…
Ridago
  • 73
  • 9