nsoutlineview

Creating a simple NSOutlineView datasource with MonoMac

被刻印的时光 ゝ 提交于 2019-12-07 02:55:19
问题 I cant seem to figure out how to create a simple NSOutlineView with 2 columns, and a datastructure that is more than 1 level deep (a hierachy). I've been researching this for days, and all I can find is Objective C examples, which I really can't use for anything. I understand there are different patterns for doing this, one being the DataSource pattern. I tried creating a class that inherited from NSOutlineViewDataSource, however thats all I got, I have no clue on what I should do next! Lets

Shaving a couple levels of indentation off of an NSOutlineView

余生颓废 提交于 2019-12-07 01:50:48
问题 I have an outline view where I don't want to indent the top couple levels (they have a distinctive appearance anyway), but I do want to indent subsequent levels. How can I do this? I've tried overriding -levelForRow: and -levelForItem: to subtract 2 from the return values, but this didn't help. I also tried overriding -frameOfOutlineCellAtRow: to subtract 2 * indentationPerLevel from the frame's width, but that didn't help either, possibly because I'm not showing disclosure triangles. Any

viewForTableColumn not being called for child items in view-based NSOutlineView

亡梦爱人 提交于 2019-12-06 14:51:01
I have an issue that the method -(NSView *)outlineView:(NSOutlineView *)outlineView viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item; is not being called when the item isn't a group item. The methods -(BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item; -(BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item; are implemented to return YES for the (same and) correct set of header/group items. The following methods -(NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item; -(id)outlineView:(NSOutlineView *)outlineView

Building an NSOutline view with Check marks

对着背影说爱祢 提交于 2019-12-06 09:31:36
I am looking to add checkboxes to NSOutlineview using the correct Apple recommended method - however its not clear from the documentation. How do I add the behavour to allow users whereby if I click a parent checkbox, then it will select the children, and if I unclick it - it will deselect the children of that item? edit: I have simplified my question and added image to make it clearer ( hopefully) My Approach: I have been using the wonderful answer by Code Different to build an Outline view in my mac app. https://stackoverflow.com/a/45384599/559760 - I chose to populate the NSoutLine view

CALayer + NSOutlineView/NSTableView

隐身守侯 提交于 2019-12-06 08:20:34
Here is the issue: a view-based NSOutlineView (or NSTableView, both have the issue) contains a custom control hosting a CALayer, for custom animation purposes. When resizing the outline view, or after deleting rows (animated deletion), the CALayer draws at the wrong place. This is just after an horizontal resize (the gray square is the CALayer): This is just after deleting the row where the gray square is missing (the gray square is the CALayer): It looks like the CALayer is drawn a little later than the view hierarchy itself, and in the case of the row deletion, isn't redrawn/removed at all.

Delegate events for NSTextField in a view-based NSOutlineView?

廉价感情. 提交于 2019-12-06 05:06:54
问题 I have a flawless functioning view-based NSOutlineView with a proper set-up datasource in my project. Now I want to allow the user to change certain entries. So I made the NSTextField in the IB editable. For a cell-based NSOutlineView you can use the delegate method outlineView:setObjectValue:forTableColumn:byItem: however it's not available for a view-based NSOutlineView as stated in the header file for the NSOutlineViewData protocol: /* View Based OutlineView: This method is not applicable.

Changing default font size for NSTable/NSOutlineView

流过昼夜 提交于 2019-12-06 04:44:56
I dont quite understand how to change (decrease) the font size for the text in my NSOutlineView. The default text is larger than most applications use for their font size. There is some heirachical thing where you dont set the font directory but you inherit from something "above" the table or outline view. Is there anywhere that neatly explains this? NSOutlineView is a sublcass of NSTableView . So an outline view also has columns, each of which has its own cell associated with it. The outline view will use the cell associated with each column to draw its content. So, if you want to change the

Should I use a background thread for my UI actions?

不问归期 提交于 2019-12-06 04:18:36
Background I've got an NSOutlineView that shows TrainingGroup entities. Each TrainingGroup represents a folder on the local machine. The NSOutlineView is bound to an NSTreeController with a fetch predicate of IsTrained == 0 Each TrainingGroup can be assigned to a project. Each TrainingGroup has many TrainingEntries that show a time worked on that file. When the TrainingGroup is assigned to a project, the IsTrained is set to YES . On assign to a project, all descendants are also assigned to that project and their IsTrained property is set to YES too. Project column is bound to projectTopLevel

NSOutlineView expand / collapse animation from code

我是研究僧i 提交于 2019-12-06 03:17:49
问题 i'm wondering how does one animate the expansion/collapse of an NSOutlineView's tree node from code ? // this works ok but doesn't animate NSTreeNode *node = [self.outlineView itemAtRow:self.outlineView.clickedRow]; if([self.outlineView isItemExpanded:node]) { [self.outlineView.animator collapseItem:node]; }else{ [self.outlineView.animator expandItem:node]; } an outline view naturally animates if you expand a node via the default-drawn arrow so there IS a way... 回答1: My original code was OK,

Data for NSOutlineView Source List

半世苍凉 提交于 2019-12-05 18:48:15
i've got a Delegate class for a Source List. But i don't know what type the return variable of outlineView:objectValueForTableColumn:byItem: should be. At the Moment my code looks like this, all the structure things work but there is no text shown: @interface DataSource : NSObject<NSOutlineViewDelegate,NSOutlineViewDataSource> @end And the .m @implementation DataSource // Data Source methods - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { return (item == nil) ? 1 : [item numberOfChildren]; } - (BOOL)outlineView:(NSOutlineView *)outlineView