nstableview

UITableView-like NSTableView

依然范特西╮ 提交于 2020-01-01 05:24:12
问题 I wondered how I can make a NSTableView to behave like a UITableView on iOS . For example, splitting the content into sections as well as the typical behaviour of the section headers. Is that possible? If so, how? Thank you very much. 回答1: Check NoodleStickyRowTableView: http://www.noodlesoft.com/blog/2009/09/25/sticky-section-headers-in-nstableview/ It's part of NoodleKit: https://github.com/MrNoodle/NoodleKit 回答2: One of the differences is that UITableView's "cells" are actually Views,

Get height of content in NSTableView

一笑奈何 提交于 2020-01-01 05:22:33
问题 Is there a way to get the height of the content in an NSTableView . In iOS, you can use the -contentSize method of UIScrollView . However, the -contentSize method of NSScrollView seems to just return the height of only the visible section of the NSScrollView , not including whatever is offscreen. So, how can this be done on a Mac? 回答1: - (NSSize)contentSize in Appkit returns the size of the NSClipView , and not the height of the content that scrolls inside the table view. I don't know how

NSTableView: detecting a mouse click together with the row and column

对着背影说爱祢 提交于 2019-12-28 09:18:19
问题 I'm trying to detect when a mouse click occurs in an NSTableView, and when it does, to determine the row and column of the cell that was clicked. So far I've tried to use NSTableViewSelectionDidChangeNotification, but there are two problems: It only triggers when the selection changes, whereas I want every mouse click, even if it is on the currently selected row. The clickedRow and clickedColumn properties of NSTableView are both -1 when my delegate is called. Is there a better (and correct)

check whether mouse was clicked inside NSTableView

江枫思渺然 提交于 2019-12-25 04:29:21
问题 I have some mouse click-checking code in a NSTableView subclass that can intercept and modify mouse events to allow for clicking of buttons inside the table but the problem is that these events are also intercepted if the mouse is clicked anywhere else, not just on the table. My question therefore: How can I check if NSPoint.locationInWindow is within ONLY the table's visible bounds? My code below lets the event through even if clicked somewhere where a table row is scrolled beyond the

Possible to use NSView subclass in NSTableView?

妖精的绣舞 提交于 2019-12-25 03:53:45
问题 I have an NSView subclass that I'd like to use in an NSTableView . Normally of course I'd use a NSTableCellView subclass but this view will be used elsewhere. Possible? 回答1: Change your NSView subclass to inherit from NSTableCellView instead of NSView , since NSTableCellView also inherits from NSView too. 回答2: There's no requirement that the cell view used for a view-based table view be an NSTableCellView or subclass. It's perfectly OK to use an instance of some other view object. For example

Nscell Size Not Increasing With Row Height During Text Edit

限于喜欢 提交于 2019-12-25 03:08:49
问题 My NSTableView has variable height rows. The rows correctly resize after an edit of a cell has been completed, and during/after resizing the column/table. The Row also correctly resizes while a user is typing into the text cell. However, the cell itself does NOT resize during editing to match the height of the row. Does anyone have any ideas on this? In this screenshot one end-edit has occurred already (which is why the text area is larger than 1 line) but there is currently enough text in

Understand drop in NStableView

怎甘沉沦 提交于 2019-12-25 03:05:04
问题 I have a NStableview with datasource and bindings in IB. DataSource object get they value from NSOpenPanel Action. Then, a function receive URLS from openPanel, and do the dirty work very well. So, what i would achieve is offer an alternative to openPanel via Drag operation. Sincerely i need to tell that i don't have quite skill about drag and drop, and after read and read documentation about it, still have o couple of fly in my hand.... At the moment i can drop file in tableview, receive the

How to get index of currently selected row and column in NSTableView

不打扰是莪最后的温柔 提交于 2019-12-25 02:18:15
问题 I'm working on a small MacOS app with a super simple NSTableView. When the user select a cell I need to know the column and the row index of this cell. I've implemented the method - (void)tableViewSelectionDidChange:(NSNotification *)notification and ask to the NSTableView for selectedColumn and selectedRow , but when I click on the table the result is always the selection of an entire Row. (in fact selectedRow return the right index number and selectedColumn return -1 = no selection) How can

Binding an NSTableView to an NSArrayController instead of fetching the data directly from my model array

别等时光非礼了梦想. 提交于 2019-12-25 01:28:49
问题 Current Situation: Direct Binding I have an NSTableView which displays the data that comes from an NSArray of my custom objects. Desired Approach: Array Controller However, It would be "more best practise" to use an NSArrayController instead as a facade to my arbritary model object. So I duplicated the table in my application and created a new NSViewController where I bound the Table Content of the NSTableView to the NSArrayController . I added an IBOutlet for this class so I can now setup my

How to create a custom NSTableCellView from a NIB?

瘦欲@ 提交于 2019-12-24 22:42:56
问题 I'm new to Swift and I am struggling with NSTableView! I'm trying to create a custom NSTableCellView from a NIB. I want to load the cell from a NIB because: - it will be reused in multiple columns and multiple table-views - it will be visually and functionally complex (relatively) - it is likely to evolve during development I'm able to load the cell in my table view but I'm getting a "Failed to connect outlet from... missing setter or instance variable" error in the debug area when I try to