nstableview

View-based NSTableView vs NSCollectionView?

为君一笑 提交于 2019-12-22 05:23:29
问题 I've understood the fly-weight approach of cell-based NSTableView and I think I understand the differences with NSCollectionView. Differences between (cell-based) NSTableView and NSCollectionView However, a bit less obvious is the differences between view-based NSTableView and NSCollectionView. With NSCollectionView's flexibility in displaying its items (i.e. in a grid layout) which could emulate a tableView's list (a grid with maximum one column) and excluding personnal preferences, why

NSTableView - Table Column with rich formatted text and image

半腔热情 提交于 2019-12-21 21:28:17
问题 I am new with Cocoa and I want to display one-column NSTableView with multiline rich-formatted (different fonts and colors within one cell) and images. Is the NSTableView a good choice for this task ? If it how can i get it ? Do I need to use NSCell control ? I will be thankful for good stating tutorial and examples. I have tried to google it, but not find something useful. 回答1: Cell-based table view approach With a cell-based table view you can't do this because the standard cell NSImageCell

Adding footer in NSTableView

僤鯓⒐⒋嵵緔 提交于 2019-12-21 19:54:32
问题 I'm developing a Cocoa application for Mac. In the application, I have to add a footer to a table for adding and deleting rows like in the attached image: Is there any default controls present for such type of footer view? If there is no such default control, I have to use the image. 回答1: There is no such default control. you can create a custom control like this or you can get this effect by taking a image and two buttons. 回答2: You can check out Bottom bar in NSWindow for a similar problem

Reordering of NSTableview Rows in View based Tableview

ぃ、小莉子 提交于 2019-12-21 19:52:34
问题 As per apple documentation drag and drop NSTableView delegate methods are called only for cell based TableViews not for View based. So there is no way to do reordering of rows using drag & drop for view based NSTableView ? 回答1: I have created a small sample project which has an NSOutlineView where you can add and remove items as well as reorder them. This is not an NSTableView but the implementation of the Drag & Drop protocol is basically identical. I implemented drag and Drop in one go so

Cocoa - View-Based NSTableView, using one cell in multiple tables

淺唱寂寞╮ 提交于 2019-12-21 18:06:22
问题 I've got a problem. [for which the only example I can find was shown during one of the WWDC 2011 presentations ("Maximising Productivity in Xcode 4"), but there is no source available (it was an app called Birdathon). Everything else I come up with is for iOS, and doesn't translate across.] Basically, I have some view-based NSTableViews, and currently lay out the image / text fields within my NSTableCellView directly in the column. I've got a subclass of NSTableCellView which gives me the

Coloring NSTableView Text per row

允我心安 提交于 2019-12-21 05:11:09
问题 I have a NSTableView that is displaying an array of objects I have. For each of these objects (rows) I would like to change the color of the text displayed depending on the results of a function I run on each object; So for example all the object in the table that exist in another list (or some other requirement) I want to display them in green text, and objects that don't exist display in red. How would I go about doing this? 回答1: Assuming that you have NSTextFieldCell in your table (for

Getting duplicate header button cell in NSTableView when using NSPopUpButtonCell

一曲冷凌霜 提交于 2019-12-21 02:54:48
问题 I have a dynamic NSTableView which can add a number of columns depending on the data provided. For each column I have set the header cell to be a NSPopUpButtonCell. (Side-note: I've had to use a custom subclass class for NSTableHeaderView otherwise the menu doesn't pop-up). All works well, apart from a duplicate or extra header button cell on the top right. It mirrors perfectly the previous column selection as shown in screenshots. My question is how do I stop the NSTableView from recycling

Draw NSTableView Alternating Rows Like iTunes 11

﹥>﹥吖頭↗ 提交于 2019-12-20 09:47:19
问题 I am aware that there are other questions on SO about changing alternating row colors. That's easy and it's not what I want to do. I want to draw custom alternating-colored rows in a view-based NSTableView that look like those from iTunes 11 (slight bezel at the top and bottom of the row, as shown in this screenshot): NOTE: I know I can subclass NSTableRowView and do my custom drawing there. However, this is NOT an acceptable answer because the custom row will only be used for rows that have

Change highlighting color in NSTableView in Cocoa?

妖精的绣舞 提交于 2019-12-20 09:06:56
问题 I am developing a Cocoa application and encountered a problem with highlighting. Standard highlighting color in MAC OS X applications is blue, but it doesn't suit my app, since because of design concepts, I need a green color for highlighting. I tried to subclass NSTableview and override method - (void)highlightSelectionInClipRect:(NSRect)clipRect but it didn't help. How to fix this problem? 回答1: I am using this, and so far works perfectly: - (void)highlightSelectionInClipRect:(NSRect

Change highlighting color in NSTableView in Cocoa?

强颜欢笑 提交于 2019-12-20 09:05:57
问题 I am developing a Cocoa application and encountered a problem with highlighting. Standard highlighting color in MAC OS X applications is blue, but it doesn't suit my app, since because of design concepts, I need a green color for highlighting. I tried to subclass NSTableview and override method - (void)highlightSelectionInClipRect:(NSRect)clipRect but it didn't help. How to fix this problem? 回答1: I am using this, and so far works perfectly: - (void)highlightSelectionInClipRect:(NSRect