nstableview

how to code NSButton to look just like image

只谈情不闲聊 提交于 2021-01-26 19:42:31
问题 Using code (not the Interface builder) I need to create an NSButton that looks like an image. Specifically I want to use NSImageNameStopProgressFreestandingTemplate and I need it not to look like button but to look like the image. This means: 1. No 'button down' look 2. No border, no any visibility of the button Thanks. 回答1: I know this response is a bit late, but you could try this, given thisButton : [thisButton setImage:[NSImage imageNamed:NSImageNameStopProgressFreestandingTemplate]];

How to change selection color for NSTableView which use NSArrayContoller as content source?

元气小坏坏 提交于 2021-01-02 05:32:19
问题 I have an NSTableView (view Based) who show info's from an NSarrayController. All connections are made from IB. Everything works fine, but blue selection color doesn't look ok with my design idea, so I want to change this color with my own color, but until now I failed. class MyTable: NSTableView, NSTableViewDelegate { override func drawBackgroundInClipRect(clipRect: NSRect) { if self.isRowSelected( self.selectedRow ){ //NSColor.brownColor().colorWithAlphaComponent(0.9).setFill() //

NSTableColumn size to fit contents

狂风中的少年 提交于 2020-12-29 03:46:47
问题 I am developing in and against Mac OS X 10.6 (Snow Leopard). When I double-click between two of my NSTableView's column headers, the column on the left autosizes, like you would expect. I want to provide this in a context menu as well, but it seems there is no publicly accessible function to do this. I've Googled, and looked at the documentation for NSTableView, NSTableHeaderView, and NSTableColumn, but found nothing. I find it hard to believe they wouldn't expose something so useful when

NSTableColumn size to fit contents

给你一囗甜甜゛ 提交于 2020-12-29 03:46:27
问题 I am developing in and against Mac OS X 10.6 (Snow Leopard). When I double-click between two of my NSTableView's column headers, the column on the left autosizes, like you would expect. I want to provide this in a context menu as well, but it seems there is no publicly accessible function to do this. I've Googled, and looked at the documentation for NSTableView, NSTableHeaderView, and NSTableColumn, but found nothing. I find it hard to believe they wouldn't expose something so useful when

Can't change column width in response to outlineViewItemDidExpand [closed]

依然范特西╮ 提交于 2020-12-15 03:57:41
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 days ago . Improve this question I want to update the column width to the width of the widest entry whenever a node in my NSOutlineView is expanded. Thus, my delegate listens to outlineViewItemDidExpand and calls [column setWidth:maxColumnWidth]; in it. maxColumnWidth is the width of the widest entry. However,

How can I have the only column of my NSTableView take all the width of the TableView?

别来无恙 提交于 2020-08-20 23:08:12
问题 I am currently trying to learn a bit of Cocoa (using the book Cocoa Programming for Mac OS X). In one of the exercises, we set up a NSTableView with only one column, to act as a list of things. What annoys me is that in Interface Builder, I could not find a way to have the (only) column always take the full width of the NSTableView . As a consequence, it always somehow looks like there are 2 columns when there is actually only one. Any idea ? 回答1: This is just an IB problem that happens all

Opening a gap in NSTableView during drag and drop

牧云@^-^@ 提交于 2020-05-09 17:57:57
问题 I've got a simple, single-column, view-based NSTableView with items in it that can be dragged to reorder them. During drag and drop, I'd like to make it so that a gap for the item-to-be-dropped opens up at the location under the mouse. GarageBand does something like this when you drag to reorder tracks (video here: http://www.screencast.com/t/OmUVHcCNSl). As far as I can tell, there's no built in support for this in NSTableView. Has anyone else tried to add this behavior to NSTableView and

Can't get NSTableView to display any text whatsoever

限于喜欢 提交于 2020-02-25 09:23:07
问题 I've been developing on iOS for some time, but am very new to Cocoa development, and something seemingly very simple is stumping me. I have an NSTableView, hooked up to a subclass of NSWindowController as both datasource and delegate. I have an array of "File" objects (my model class) and want to populate one column of my tableview with file types, and another with timestamps. The dataSource methods are definitely being called, as verified by setting breakpoints. In fact, I end up with an

How to Expand NSTableCellView Width When Resizing Column in NSTableView

匆匆过客 提交于 2020-01-29 04:46:44
问题 I am trying to display a path in my table view. Both columns of the table view on the left side are the same for testing/demonstration purposes. Notice how the leftmost path is truncated: When I expand the column, the (truncated) table view cell doesn't expand with the column: My question is how would I go about resizing the cell when I resize the table view column? 回答1: Found a solution, what you want to do is add a few constraints Step 1: go to the table cell view for said column Step 2:

Maverick Issue : While adding a subview on NSView

爱⌒轻易说出口 提交于 2020-01-25 11:44:04
问题 I have a NSView(outlet - detailsView) , upon that a NSSplitView (outlet - detailsSpiltView) and there are two subviews in the split view and in those subview there are different scroll view and table view. NSView(detailsView) | NSSplitView(detailsSplitView) | | NSView NSView | | NSScrollView NSScrollView | | NSTableView NSTableVIew On a certain condition I am adding a an error view on detailsView and on other conditions the table view would be populated: The code for loading errorView is the