nsoutlineview

Correct way to get rearrangeObjects sent to an NSTreeController after changes to nodes in the tree?

China☆狼群 提交于 2019-12-01 09:56:20
问题 What is the appropriate way to get rearrangeObjects to be sent to an NSTreeController after changes to nodes in the tree? I have a sample application (full code below) using an NSOutlineView and NSTreeController with a simple tree of Node objects. In Version1 of the app, when you edit the name of a Node, the tree doesn't get resorted until you click the column header or use the “Rearrange” item in the menu. The latter is set up to directly send rearrangeObjects to the NSTreeController. In

NSTableView & NSOutlineView editing on tab key

陌路散爱 提交于 2019-11-30 14:17:30
My app has an NSOutlineView and an NSTableView , and I'm having the same problem with both. With a row in either selected, pressing the tab key puts the first column into edit mode instead of making the next key view first responder. To get to the next key view, you need to tab through all of the columns. Also, shift-tabbing into either view results in the last column going into edit mode, necessitating more shift-tabs to get into its previous key view. In case it matters, I'm using the autocalculated key view loop, not my own, with my NSWindow set to autorecalculatesKeyViewLoop = YES . I

How to program a NSOutlineView?

蓝咒 提交于 2019-11-30 10:12:44
I am having trouble creating a NSOutlineView in Xcode 8 (Swift 3). I have a plist file with some information that I would like to present in an OutlineView. The plist file looks as following (example): Root Dictionary *(1 item) Harry Watson Dictionary *(5 items)* name String Harry Watson age Int 99 birthplace String Westminster birthdate Date 01/01/1000 hobbies Array *(2 items)* item 0 String Tennis item 1 String Piano The OutlineView should look pretty similar, like follow: name Harry Watson age 99 birthplace Westminster birthdate 01/01/1000 > hobbies ... (<- this should be expandable) I

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

NSOutlineView example

浪尽此生 提交于 2019-11-30 08:47:44
Please, could you give a simple complete example of Cocoa application with NSOutlineView with hierarchical data representation not so ambiguous like NSOutlineView and NSTreeController example . Thanks! valexa This example uses a simple two layer hierarchy of two parents Foo and Bar who each have two kids, Foox, Fooz and Barx, Barz respectively, the outline view is the default one with just two columns and the identifier of the second column is set to "children". NSDictionary *firstParent = @{@"parent": @"Foo", @"children": @[@"Foox", @"Fooz"]}; NSDictionary *secondParent = @{@"parent": @"Bar",

NSOutlineView Changing disclosure Image

假如想象 提交于 2019-11-30 07:37:50
I my outline view, i am adding Custom cell, To drawing custom cell, i am referring example code , present in the Cocoa documentation http://www.martinkahr.com/2007/05/04/nscell-image-and-text-sample/ I want to change the disclosure image of the cell with my custom image, i have tried following things - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { if([item isKindOfClass:[NSValue class]]) { MyData *pDt = (MyData *)[item pointerValue]; if(pDt->isGroupElement()) { [cell setImage:pGroupImage]; } } } but that too

How to get the source lists selection highlight to use the Dark Vibrancy appearance in OS X 10.10?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 03:54:49
In OS X 10.10 source lists seem to use the light vibrancy appearance. In the Finder (and in some other third party applications, Things.app for example) the selected item in the source list is indicated by a dark vibrancy appearance. For example, see the Desktop row in the image below. How can I replicate this behaviour? Do I need to use the delegate methods to specify the table row view, -outlineView:rowViewForItem: and attempt custom drawing myself or is there a more straight forward approach? If you make a standard source list UI in Xcode the default highlighting is remain the standard blue

NSTableView & NSOutlineView editing on tab key

蓝咒 提交于 2019-11-29 20:06:47
问题 My app has an NSOutlineView and an NSTableView , and I'm having the same problem with both. With a row in either selected, pressing the tab key puts the first column into edit mode instead of making the next key view first responder. To get to the next key view, you need to tab through all of the columns. Also, shift-tabbing into either view results in the last column going into edit mode, necessitating more shift-tabs to get into its previous key view. In case it matters, I'm using the

NSOutlineView spring loading exits over NSImageView but not NSButton

十年热恋 提交于 2019-11-29 18:11:18
I have an NSOutlineView subclass that implements the NSSpringLoadingDestination. The outline view is populated with NSTableCellViews. Each table cell view has an NSTextField and NSImageView. It looks just like the name column in the Finder window: icon and text. When I drag a row over the text field in another row everything works fine. When the cursor goes over the NSImageView, however, the spring loading exits. The outline view also loses the highlight for that row. If I replace the image view with an NSButton containing the image, the spring loading does not exit. And the outline view

View-based NSOutlineView without NIB?

不想你离开。 提交于 2019-11-29 14:28:59
问题 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