nsbuttoncell

Problems when deselecting checkboxes inside bound NSTableview's columns

徘徊边缘 提交于 2019-12-23 04:24:10
问题 I am using this project, created by aneesh171 that shows the creation of checkboxes inside NSTableView and how to bind them. I am new to OSX development and trying to understand how it works. The project is basically checkboxes inside a NSTableView's column that is bound to an array controller. For some reason, when I deselect one of those checkboxes, the following messages appear on the console window: 2014-04-03 04:22:55.579 MyApp[5735:303] Error setting value for key path objectValue

Custom NSButtonCell, drawBezelWithFrame not called

断了今生、忘了曾经 提交于 2019-12-23 02:17:29
问题 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 override the Method drawBezelWithFrame:inView: and in the initWithFrame Method of my subclassed NSButton I use setCell to set my CustomCell in the Button. However, drawBezelWithFrame gets not called and I don't understand why. Can someone point out what

How to create a NSTextFieldCell, that in edit mode displays a custom view instead of NSTextField?

两盒软妹~` 提交于 2019-12-22 00:09:28
问题 I have a tableView, with 3 columns containing NSTextFieldCell. Everything is populated with bindings. The text of the cells of one of the column is computed and is not editable directly. For this column, I would like when the cell goes into edit mode , to display a button or a custom view instead of the textField . Said in an other way, I want an NSCell that is a NSTextFieldCell when not being edited, and a NSButtonCell (or a custom view) when being edited. Any hint to move on to this? Here

NSButton set background color macOS 10.12

可紊 提交于 2019-12-11 06:38:17
问题 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 button.layer.backgroundColor (including with and without importing QuartzCore and setting wantsLayer ). Getting the NSButtonCell from the NSButton and changing the background color. I've tried this with bordered, unbordered, transparent, etc. No change in

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

情到浓时终转凉″ 提交于 2019-12-11 02:29:41
问题 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: - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView { return 10; } - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex { NSButtonCell *buttonCell; if(aTableView == dimensionTable) { [dimensionButtonCell

How to set background color while selecting row of NSOutlineView

假如想象 提交于 2019-12-10 19:28:35
问题 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 codes. The Image is set using these codes [cell setImage:[NSImage imageNamed:@"sbWarn.png"]]; [cell setImagePosition:NSImageOverlaps]; [cell setBackgroundColor:[NSColor clearColor]]; The problem is when I select a row the selected row shows a black

Checkbox on table column won't register click

此生再无相见时 提交于 2019-12-08 01:36:37
问题 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 are set to be editable but if I click on the checkbox the check won't get set. Am I missing something? Update How I'm (trying) setting the state on the checkbox: - (void)tableView:(NSTableView *)theTableView setObjectValue:(id)theObject

NSButtonCell in NSTableView: click handling

倖福魔咒の 提交于 2019-12-07 09:08:38
问题 I set NSButtonCell as a cell type in a Table Column in my NSTableView . I implemented an IBAction method, but I can't wire it with NSButtonCell in IB - the wire don't want to highlight a button from NSTableView . How to connect a method with NSButtonCell ? Or maybe there'se another way to handle its click event? Thanks 回答1: You should be able to wire up a connection from the cell by control+dragging to any object in your NIB. Just make sure the cell is actually selected, and that your action

NSButtonCell as Checkbox in a NSTableVIew don't get selected

微笑、不失礼 提交于 2019-12-07 06:09:04
问题 I have a NSTableVIew for multi-selection purposes with two columns, the first one with a NSButtonCell as checkbox and the other one as a title. The idea is to check the items to be added afterwords to an array. The problem is that the checkboxes don't change its state when I click them. I've tried to attach an IBAction but the sender to de action is the TableView but not the checkbox Any ideas (or link) about how to achieve this kind of functionality? 回答1: Going on the assumption you're using

Rounded NSImage corners in a NSButtonCell

走远了吗. 提交于 2019-12-06 14:15:43
问题 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 I was looking for: How to draw a rounded NSImage but sadly it acts crazy when I use it: // In my NSButtonCell subclass - (void)drawImage:(NSImage*)image withFrame:(NSRect)imageFrame inView:(NSView*)controlView { // [super drawImage:image withFrame