nstableview

How do I select column and row from a NSTableView?

给你一囗甜甜゛ 提交于 2020-01-06 18:01:28
问题 I am writing a NSTableView based view. And I try to use: let selectedRowNumber = tableViewMesos.selectedRow and let selectedColumnNumber = tableViewMesos.selectedColumn to identify the textField that is in the cell View that I want to save into my array: taulaDeConsumsMesos[selectedColumnNumber].filesConsum![selectedRowNumber] = sender.doubleValue But a problem happens here, because the return value of selectedColumnNumber is -1 which is the value of non-selected Column for any row selected

NSTableView rounded corners

瘦欲@ 提交于 2020-01-06 08:41:43
问题 For drawing rounded corners in the NSTableView subclass I override the drawRect method - (void)drawRect:(NSRect)rect{ NSBezierPath* path = [NSBezierPath bezierPathWithRoundedRect:rect cornerRadius:7.0f]; [path addClip]; [super drawRect:selfRect]; } This works as long as the content of the table view is not too big and not showing the scrollers. But when the content gets bigger, the scrollers of the NSScrollView are displayed and the rounded edges disappear. Any hints for this? 回答1: Since a

How to apply custom styling to NSTableHeaderView?

会有一股神秘感。 提交于 2020-01-05 07:49:48
问题 So I am going for a custom looking NSTableView. I've already successfully subclassed NSTableRowView and NSTextFieldCell to achieve the look I'm going for, however I'm struggling of getting rid of the default styling for the header. I seem to be able to tweak its frame, however I'm not sure where the rest of the default styling is coming from. As you see on the screenshot the red area is the increased frame of the headerView . I'm using its CALayer to set the colour, however how to change the

Get selected row and column in view based nstable

对着背影说爱祢 提交于 2020-01-05 03:55:10
问题 I have a view based NSTable with ten or more rows and five columns. To populate data for this table, I have a dictionary of 5 arrays. So each dictionary object is for each column. Now I need to get information when I click on any cell. I am using tableViewSelectionDidChange delegate to get notified on cell selection. Using this I can get only the [myTableView selectedRow] to get to know the row selected. How can I know which column was the row in. For ex: I select/click on 5th row in 3rd

Sorting nil-valued rows always to bottom in nstableview column

前提是你 提交于 2020-01-04 06:15:08
问题 I have an NSTableview in my application containing several columns. When I click on one column header in order to have it sorted ascending, rows with a nil-value in that column are being sorted on top followed by non-nil-valued rows in ascending order. If I reclick on the same column, first the non-nil-valued rows are being shown in descending order followed by nil-valued rows. What I want to do is having nil-valued rows always sticked to the bottom. So at first non-nil-valued rows being

Sorting nil-valued rows always to bottom in nstableview column

夙愿已清 提交于 2020-01-04 06:11:13
问题 I have an NSTableview in my application containing several columns. When I click on one column header in order to have it sorted ascending, rows with a nil-value in that column are being sorted on top followed by non-nil-valued rows in ascending order. If I reclick on the same column, first the non-nil-valued rows are being shown in descending order followed by nil-valued rows. What I want to do is having nil-valued rows always sticked to the bottom. So at first non-nil-valued rows being

How to change font size of NSTableHeaderCell

China☆狼群 提交于 2020-01-03 21:08:11
问题 I am trying to change the font size of my NSTableView within my code to allow the user to change it to their liking. I was successful by changing the font size of each NSTableCellView but failed to do so by the header cells. I was trying to do it like this let headerCell = NSTableHeaderCell() let font = NSFont(name: "Arial", size: 22.0) headerCell.stringValue = "firstname" headerCell.font = font customerTable.tableColumns[0].headerCell = headerCell The stringValue of the header cell will be

i want to change the height of the view based NStableview cell based on label added to the cell using swift?

喜你入骨 提交于 2020-01-03 04:47:07
问题 How to change view based tableview cell height dynamically after loading data into cell using swift os x application. Programmatically I added labels to the custom view based on that i want to change the height of the tableview cell. I used visual format language to add autolayout constraints. i have created imageview and labels programmatically inside custom view based nstableview cell. i want to change the cell height according to the labels added to the custom cell. import Cocoa class

Mavericks issue: noteHeightOfRowsWithIndexesChanged: does not animate

旧时模样 提交于 2020-01-03 03:23:17
问题 When calling [myTableView noteHeightOfRowsWithIndexesChanged: myIndexSet] inside an NSAnimationContext group, the height of the rows animates on 10.8, but does not animate on 10.9: it jumps instantaneously to the final height instead. After some experimentation, I found that it does animate on 10.9 if you do not place that call to the table view in an NSAnimationContext group. This result is a bummer because I wanted to have other animations on the rows in sync with the height animation from

Subclass NSTableRowView for NSOutlineView

女生的网名这么多〃 提交于 2020-01-02 05:31:15
问题 If you have a tableView and want to use a subclass of NSTableRowView, you can use the delegate function - (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row. Any ideas of how I can do this with an NSOutlineView (without subclassing NSOutlineView)? 回答1: The NSOutlineView has this delegate method: (NSTableRowView *)outlineView:(NSOutlineView *)outlineView rowViewForItem:(id)item that serves the same purpose for an outline view. I don't see this method in my docs