nsoutlineview

NSTextField not calling delegate when inside an NSTableCellView

╄→尐↘猪︶ㄣ 提交于 2019-11-29 10:49:56
I have a fairly vanilla Source List (dragged out from the Object Library) in my app, with an NSTreeController as its data source. I set the NSTextField inside the DataCell to be editable, but I want to be able to turn that off for some cells. The way I figured you would do this, is with a delegate for the NSTextField , but none of the delegate methods I've tried get called. Is there something I'm missing? I have the delegate set with an outlet in my XIB, and it happens to be the delegate to the owner NSOutlineView , as well, implementing both the NSOutlineViewDelegate and NSTextFieldDelegate

NSOutlineView Changing disclosure Image

巧了我就是萌 提交于 2019-11-29 10:15:36
问题 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 =

NSOutlineView reloadItem: has no effect

匆匆过客 提交于 2019-11-29 02:55:10
问题 I'm trying to release some strain on a view-based NSOutlineView for which I changed a single item property and which I initially reloaded just fine using [myOutlineView reloadData] . I tried [myOutlineView reloadItem: myOutlineViewItem] but it never calls - (NSView *)outlineView:(NSOutlineView *)ov viewForTableColumn:(NSTableColumn *)tableColumn item:(id)item and consequently the data is not updated. -(void)reloadOutlineViewObject { //[myOutlineView reloadData]; //Reload data just fines but

How do you add context senstive menu to NSOutlineView (ie right click menu)

假如想象 提交于 2019-11-28 22:33:48
问题 How do you add the ability to right click on a row in an NSOutlineView so you can say delete an object or some other activity. (ie Like when you right click on a folder in the Apple Mail app) I think I am half way there, I have a subclass of NSOutlineView that allows me to catch the right click and display a context menu based on the selected row rather than the row the mouse is clicking on. @implementation NSContextOutlineView - (NSMenu *)defaultMenu { if([self selectedRow] < 0) return nil;

NSOutlineView: remove disclosure triangle and indent

断了今生、忘了曾经 提交于 2019-11-28 15:50:31
问题 I'm using NSOutlineView for a project, and can't seem to figure out two things: How to remove the disclosure triangle for tree nodes. Apps like iTunes seem to be able to do this: Is there some sort of NSOutlineView Delegate method that is used for this? Or does it require a subclass? How to disable indenting for items. I've tried using setIndentationPerLevel: and setting it to 0, as well as changing the column indent to 0 in Interface Builder, but it does not seem to have any effect. 回答1: You

iTunes-like count buttons using Cocoa bindings

馋奶兔 提交于 2019-11-28 12:42:56
问题 I want to display some items in my sidebar, with the count of each tag also displayed: How do I do this efficiently and automatically? The easy option would be to use cocoa bindings, but I'm not sure what the best way to do this: would each button needs it's own NSArrayController with a fetch predicate set for the 'tag'? That could end up with X number of NSArrayControllers (one for each tag) which would be pretty heavy-weight (I would think). The other option is to create fetch requests

How to customize disclosure cell in view-based NSOutlineView

旧街凉风 提交于 2019-11-28 06:01:08
I'm trying to customize the disclosure arrow appearance in my view-based NSOutlineView. I saw that it's recommended to use - (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item delegate method to achieve it. The problem is that this method is not called for some reason. I have 2 custom cell views - one for item and second for header item. May be this method is not called for view-based outline views? May be something became broken in Lion? Please shed some light. Monolo This answer is written with OS X 10.7 in

NSTextField not calling delegate when inside an NSTableCellView

人走茶凉 提交于 2019-11-28 03:51:44
问题 I have a fairly vanilla Source List (dragged out from the Object Library) in my app, with an NSTreeController as its data source. I set the NSTextField inside the DataCell to be editable, but I want to be able to turn that off for some cells. The way I figured you would do this, is with a delegate for the NSTextField , but none of the delegate methods I've tried get called. Is there something I'm missing? I have the delegate set with an outlet in my XIB, and it happens to be the delegate to

How to customize disclosure cell in view-based NSOutlineView

随声附和 提交于 2019-11-27 01:09:52
问题 I'm trying to customize the disclosure arrow appearance in my view-based NSOutlineView. I saw that it's recommended to use - (void)outlineView:(NSOutlineView *)outlineView willDisplayOutlineCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item delegate method to achieve it. The problem is that this method is not called for some reason. I have 2 custom cell views - one for item and second for header item. May be this method is not called for view-based outline views? May be