nstablecellview

NSOutlineView row not editable by “Return” key anymore after reloading a different table view cell

萝らか妹 提交于 2021-02-05 08:11:42
问题 I'm running into the strangest issue with my NSOutlineView : Everything is set up in a storyboard, i.e. the outline view and two NSTableCellView s The two cell views are mostly the same, only one shows an icon, the other one doesn't I can begin editing an item (row) by pressing the Return key, i.e. the NSTextField that is part of my NSTableCellView enters into edit mode. This is the default behavior and works fine so far. However: After editing ends and the item was changed, I use the second

NSOutlineView row not editable by “Return” key anymore after reloading a different table view cell

◇◆丶佛笑我妖孽 提交于 2021-02-05 08:11:32
问题 I'm running into the strangest issue with my NSOutlineView : Everything is set up in a storyboard, i.e. the outline view and two NSTableCellView s The two cell views are mostly the same, only one shows an icon, the other one doesn't I can begin editing an item (row) by pressing the Return key, i.e. the NSTextField that is part of my NSTableCellView enters into edit mode. This is the default behavior and works fine so far. However: After editing ends and the item was changed, I use the second

Custom drag image with NSTableView as drag source

做~自己de王妃 提交于 2019-12-18 08:24:45
问题 Is it necessary to subclass NSTableView or NSTableCellView to create a custom drag image when the tableView is the drag source? If not, what is the magic method I am missing to do this? I cannot seem to find anything solid. NSTableCellView subclasses have can (slightly mysteriously) override: @property(retain, readonly) NSArray *draggingImageComponents (array of NSDraggingImageComponent instances that will get composited together (who knows in what fashion they get composited...)) NSTableView

NSTableViewCell setSelected?

寵の児 提交于 2019-12-12 03:17:31
问题 How do I communicate between my NSViewController and the NSTableViewCell when I select that cell on my tableView? On iOS you could use setSelected but in OSX it is totally different. The NSTableCellView class doesn't have any function like that. I might be missing something simple. How do I talk with that cell? I have a custom class cell and on my tableView controller, I got: func tableView(tableView: NSTableView, shouldSelectRow row: Int) -> Bool { let previousSelected = NSIndexSet(index:

Why does [[NSTableCellView alloc] init] produce a nil- text field?

允我心安 提交于 2019-12-11 01:43:58
问题 The log lines below will show "Table cell: [valid value logged here]" but "Text field: (null)". I'm actually trying to build an NSOutlineView programmatically, and it works with a cell-based approach, but not with a view-based approach. Can someone tell me what I'm doing wrong? -(NSView*)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item { NSTableCellView* view = [outlineView makeViewWithIdentifier:tableColumn.identifier owner:self]; if

How to trigger an action from a NSTableCellView in view based NSTableView when using bindings

人盡茶涼 提交于 2019-12-06 03:20:59
问题 I'm facing a problem with a view-based NSTableView running on 10.8 (target is 10.7, but I think this is not relevant). I'm using an NSTableView, and I get content values for my custom NSTableCellView through bindings. I use the obejctValue of the NSTableCellView to get my data. I added a button to my cell, and I'd like it to trigger some action when clicked. So far I have only been able to trigger an action within the custom NSTableCellView's subclass. I can get the row that was clicked like

How to trigger an action from a NSTableCellView in view based NSTableView when using bindings

雨燕双飞 提交于 2019-12-04 07:54:58
I'm facing a problem with a view-based NSTableView running on 10.8 (target is 10.7, but I think this is not relevant). I'm using an NSTableView, and I get content values for my custom NSTableCellView through bindings. I use the obejctValue of the NSTableCellView to get my data. I added a button to my cell, and I'd like it to trigger some action when clicked. So far I have only been able to trigger an action within the custom NSTableCellView's subclass. I can get the row that was clicked like this, using the chain: NSButton *myButton = (NSButton*)sender; NSTableView *myView = (NSTableView*

Can't CTRL+Drag NSButton to custom NSView header

[亡魂溺海] 提交于 2019-12-02 06:21:05
问题 I'd like to create a custom NSTableCellView instantiated by Interface Builder. I've set my Table Cell View class to MyTableCellView , and properly created MyTableCellView : NSTableCellView .m/.h files. However, I just can't CTRL+Drag a simple button from inside this view to MyTableCellView.h in order to create an IBOutlet . Here is a video to show what happens: http://youtu.be/sNNbuVT-SZs. How the view is subclassed: How I try to CTRL+Drag a button Also, sometimes, Interface Builder just don

Can't CTRL+Drag NSButton to custom NSView header

心已入冬 提交于 2019-12-02 00:48:31
I'd like to create a custom NSTableCellView instantiated by Interface Builder. I've set my Table Cell View class to MyTableCellView , and properly created MyTableCellView : NSTableCellView .m/.h files. However, I just can't CTRL+Drag a simple button from inside this view to MyTableCellView.h in order to create an IBOutlet . Here is a video to show what happens: http://youtu.be/sNNbuVT-SZs . How the view is subclassed: How I try to CTRL+Drag a button Also, sometimes, Interface Builder just don't allow the cell view's class to be modified. What's happening ? I finally found a solution, that is a

View-based NSOutlineView without NIB?

冷暖自知 提交于 2019-11-30 09:38:14
NSOutlineView is a subclass of NSTableView . And currently, NSTableView supports two implementations. Cell-based. View-based. To make OSX 10.8 Finder style side bar ( with automatic gray Icon styling ), need to use view-based table view with source-list highlight style. With NIBs, this is typical job. Nothing hard. (see SidebarDemo ) But I want to avoid any NIBs or Interface Builder. I want make the side bar purely programmatically. In this case, I have big problem. AFAIK, there's no way to supply prototype view for specific cell. When I open .xib file, I see <tableColumn> is containing