nsoutlineview

NSOutlineView and NSTreeController example

醉酒当歌 提交于 2019-12-12 07:46:22
问题 Please send me some links on how to use NSOutlineView with NSTreeController bindings without using core data. 回答1: In addition to the documentation, Apple's sample SourceView project should help you better understand things: "SourceView" is a Cocoa application that demonstrates how to use NSOutlineView driven by NSTreeController and various other Cocoa classes to produce a Finder-like left column source view. Among the key features used to imitate this commonly used view are the use of

Is there a minimum indentationPerLevel of 16?

血红的双手。 提交于 2019-12-12 03:44:46
问题 I've noticed that setting indentationPerLevel to something smaller than 16 doesn't work with NSOutlineView . It always seems to indent by at least 16 pixels. I've tried to set indentationPerLevel to 4, 8, and 12 but the visible indentation is always 16 pixels, although getIndentationPerLevel returns the size I've set it to. The visible indentation, however, always seems to be at least 16 pixels. An exception is setting indentation to 0. This works and removes the indentation. Setting it to 4,

Regarding NSoutlineView and WriteItem | Drag-and-Drop Problem

自作多情 提交于 2019-12-12 02:06:10
问题 To handle Drag-n-Drop have done following, -(void)InitMyOutlineView{ - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - -- -- - - - - - - - - [pMyOutlineView registerForDraggedTypes: [NSArray arrayWithObject:NSStringPboardType]]; /* I tried both Yes and No */ [pMyOutlineView setDraggingSourceOperationMask:NSDragOperationEvery forLocal:NO]; - - - - -- - - - - - -- - - - - - - -- - - - - - - -- -- - - - - -- - - - - - - - - - - - -- - - - } The WriteItem method as below, -

How to detect scrolling for NSOutlineView?

那年仲夏 提交于 2019-12-11 04:47:13
问题 I've two NSOutlineViews shown side by side they contain the same number of rows (this is a prerequisite) and I need to synchronize them when user scrolls using mouse, keyboard or scrollbars so I see the same view portion (or rows). I'm a newbie in the Cocoa land and I'm unable to find how this can be accomplished 回答1: You'll want to get the clip view of the NSOutlineView's enclosing scroll view: NSClipView * clipView = [[outlineView enclosingScrollView] contentView]; ...and set its

Edit text in NSOutlineView like Finder

瘦欲@ 提交于 2019-12-11 04:18:58
问题 If you rename a file in the Finder, the text field expands horizontally up to about the width of the column. And then it expands vertically up to three rows before scrolling. I'm assuming this has to be done in a text field outside the outline view. And I can get a text field to resize while I type. I just don't know how to place it over the outline view when necessary. And keep it pinned to the row if the outline view scrolls. Does anyone have any insights? Thanks! 回答1: Text editing is

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 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

Blue border appearing around NSScrollView

烂漫一生 提交于 2019-12-10 17:13:48
问题 I'm sure this is normal and I'm just misunderstanding something, but since making one of my NSScrollView s slightly inset from the bottom of the window (as opposed to taking the full height), a blue border has appeared around it. I've set NSNoBorder on the scroll view, so this must be something else. [scrollView setBorderType:NSNoBorder]; Any pointers would be greatly appreciated. I'd like the border to go away as it spoils the look of the app and just looks broken. I assume it's the scroll

NSOutlineView doesn't Collapse Item

与世无争的帅哥 提交于 2019-12-10 14:57:28
问题 I have a NSOutlineView, and clicking on a row will expand/collapse the item if it's expandable. if ([self.outlineView isItemExpanded:item]) { NSLog("Will collapse item : %@", item); [[self.outlineView animator] collapseItem:item]; } else { [[self.outlineView animator] expandItem:item]; } Expanding the item works as expected, however collapsing the item is not working. I did get the log before executing collapseItem:, and the item is correct. The delegate method - (BOOL)outlineView:

NSOutlineView with NSTreeController bindings with core data

痞子三分冷 提交于 2019-12-10 12:24:16
问题 Please send me some links on how to use NSOutlineView with NSTreeController bindings with using core data. https://www.dropbox.com/s/em7kxjqmxqjto88/outlineViewCoreData%20copie.zip?dl=0 this example is ok https://www.dropbox.com/s/1asg3kkf9ltwj2w/outlineViewCoreData.zip?dl=0 this example is ko. ==> why the entity EntityCategory is not key value coding-compliant for the key "category". 回答1: I have found the solution All is ok https://www.dropbox.com/s/nnh0e0atwmrqpmm/outlineViewCoreDataOK.zip