nsoutlineview

How can you get indexes of visible rows for an NSOutlineView?

和自甴很熟 提交于 2019-12-03 17:38:43
问题 How can you get a indexes of visible rows for an NSOutlineView? I need to know which level and which rows are visible. [EDIT] What I'm actually looking for is an NSOutlineView equivalent to CocoaTouch/UITableView - (NSArray *)indexPathsForVisibleRows 回答1: you can do the following: NSScrollView* scrollView = [self.tableView enclosingScrollView]; CGRect visibleRect = scrollView.contentView.visibleRect; NSRange range = [self.tableView rowsInRect:visibleRect]; in the range you will get the

View-based NSOutlineview selection gradient

。_饼干妹妹 提交于 2019-12-03 16:07:21
I'm still struggling with the view-based NSOutlineView in my little Cocoa application. I'm trying model my OutlineView after the finder one. When the Finder OutlineView loses focus (e.g. clicking any folder on the right side), the selected row (e.g. Desktop) stays selected with the bright blue gradient and does not change to the inactive blue-grey gradient. I'd like to duplicate this behaviour in my application. In a not view-based OutlineView I was able to subclass NSOutlineView and reimplement (void)highlightSelectionInClipRect:(NSRect)clipRect , so that each highlighted row could be

Binding view-based NSOutlineView to Core Data

怎甘沉沦 提交于 2019-12-03 03:53:02
问题 I'm trying to implement the new view-based OutlineView as a source list in my Mac app. I can't get values to display, though, so I made a small test app from the Core Data app template, and can't get it working right in there, either. I defined two simple classes in my data model; let's call them "Parent" and "Child". Parent has a single Attribute, "name", and a single relationship, "children". name is an optional string, and children is an optional to-many relationship to Child . Child has

Example of how to implement a view-based source list (NSOutlineView) using Cocoa Bindings?

ε祈祈猫儿з 提交于 2019-12-03 02:26:17
问题 Has anybody found a clear, concise example or guide on how to implement a source list using the view-based NSOutlineView introduced in Lion? I've looked at Apple's example project, but without any sense of direction or explanation, I'm finding it difficult to grasp the concept of exactly how they work. I know how to use the excellent PXSourceList as a fallback, but would really like to start using view-based source lists instead if at all possible. 回答1: You tagged this with the cocoa-bindings

Strange behavior using view-based NSOutline (Sourcelist)

流过昼夜 提交于 2019-12-03 02:03:27
问题 I have a (new in Lion) view-based NSOutlineView as Sidebar SourceList in my app using CoreData + NSTreeController + Bindings + NSOutlineView and an Object as NSOutlineViewDelegate. I use these delegate methods in the outlineview delegate: - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item In my case a item is group when the (Core Data) parent relationship is nil. - (NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id

Example of how to implement a view-based source list (NSOutlineView) using Cocoa Bindings?

一个人想着一个人 提交于 2019-12-02 17:21:54
Has anybody found a clear, concise example or guide on how to implement a source list using the view-based NSOutlineView introduced in Lion? I've looked at Apple's example project, but without any sense of direction or explanation, I'm finding it difficult to grasp the concept of exactly how they work. I know how to use the excellent PXSourceList as a fallback, but would really like to start using view-based source lists instead if at all possible. You tagged this with the cocoa-bindings tag, so I assume you mean "with bindings." I whipped up a quick example. Start from a new non-document

Why is my NSOutlineView datasource nil?

雨燕双飞 提交于 2019-12-02 11:24:06
This is a follow-on question from my previous one relating to why my managedObjectContext was returning to nil. I thought the direction of the question would get buried in the old one. I now get my mangedObjectContext to not return nil and when performing [outlineView reloadData] , nothing at all happens to my outlineView. I tried selectively removing parts of the code that are intended to update the outlineView to see if anything changes and the answer is no. I've since found out (after I wrote this question originally) that my dataSource association is disappearing at some stage. Notes: the

NSOulineView header cell font

坚强是说给别人听的谎言 提交于 2019-12-02 07:22:59
I'm trying to reduce the font size of the Header Cell in a NSOutlineView (source-list view-based). The problem is that using IB doesn't work for me (both modifying the font for NSTextField and NSTextFieldCell ). The views are returned by outlineView:viewForTableColumn:item: using makeViewWithIdentifier:owner: Any ideas? These steps solved the problem. 1) Select the NSOutlineView in IB. 2) In the Size Inspector select Automatic for Size Style . If it is already selected, deselect and select it again (XCode bug?) Now you can modify the font for the NSTextFieldCell (Header Cells and Data Cells)

Weird font anti-aliasing in view-based NSOutlineView

时光总嘲笑我的痴心妄想 提交于 2019-12-02 06:32:52
问题 I'm currently working on an app that uses Lion's new view-based NSOutlineView . The problem I've ran into, however, is that I don't get nice subpixel anti-aliasing. As a result, the text doesn't appear as smooth as one would expect on Mac OS X. Here are two screenshots to illustrate the issue. Finder (proper text rendering) on the left, my app on the right. Any idea what could cause that issue? 回答1: Do you have your cell views, your outline view or its enclosing scroll view to be layer backed

Weird font anti-aliasing in view-based NSOutlineView

为君一笑 提交于 2019-12-02 03:31:44
I'm currently working on an app that uses Lion's new view-based NSOutlineView . The problem I've ran into, however, is that I don't get nice subpixel anti-aliasing. As a result, the text doesn't appear as smooth as one would expect on Mac OS X. Here are two screenshots to illustrate the issue. Finder (proper text rendering) on the left, my app on the right. Any idea what could cause that issue? Do you have your cell views, your outline view or its enclosing scroll view to be layer backed? The issue here is the text on the right is not sub pixel aliased, which happens when you set a view to be