nstableview

CALayer + NSOutlineView/NSTableView

梦想与她 提交于 2019-12-08 02:25:49
问题 Here is the issue: a view-based NSOutlineView (or NSTableView, both have the issue) contains a custom control hosting a CALayer, for custom animation purposes. When resizing the outline view, or after deleting rows (animated deletion), the CALayer draws at the wrong place. This is just after an horizontal resize (the gray square is the CALayer): This is just after deleting the row where the gray square is missing (the gray square is the CALayer): It looks like the CALayer is drawn a little

Sharing an NSDateFormatter between NSTextFields in view-based NSTableView?

一世执手 提交于 2019-12-08 02:25:41
问题 I've searched high and low for the answer to this, but alas, I'm here. As I know that NSDateFormatter objects are costly to create, I don't want to instantiate one for every NSTextField inside of my table. The problem I'm facing is that my table is view-based (as opposed to cell-based), and when attempting to connect a shared instance of a date formatter, I get the yellow warning symbol and this message: Unsupported Configuration: Outlet 'formatter' of 'Text Field Cell - Table View Cell' is

Checkbox on table column won't register click

此生再无相见时 提交于 2019-12-08 01:36:37
问题 I've a table view to which I add columns dynamically. It must be done this way because I can't predict how many or which columns I will need. Some columns are checkboxes but I can't click on them when I run my application. The column and checkbox are set to be editable but if I click on the checkbox the check won't get set. Am I missing something? Update How I'm (trying) setting the state on the checkbox: - (void)tableView:(NSTableView *)theTableView setObjectValue:(id)theObject

How to do collapse and expand view in mac application?

…衆ロ難τιáo~ 提交于 2019-12-07 22:43:27
I am new to mac application development, here i want to do expand and collapse view in my custom view(NSView) here the sample image How can i achieve these kind of collapse and expand cell in NSViewController not in NSWindow... Is it possible using NSTableView? I know its a simple question but i facing problem. Please suggest me some sample code or links.. Thanks Collapsing / expanding can be implemented by adjusting auto layout constraints in the action method of the disclosure triangle button. @property (nonatomic, weak) IBOutlet NSLayoutConstraint *moreInfoBoxHeight; [[self

Adding an editable NSTextFieldCell to my NSTableView

妖精的绣舞 提交于 2019-12-07 19:23:27
问题 I have an NSTableView which displays some information representing a custom object of mine. I am not using bindings. Typically, I create my own NSCells to display data, but for once I'm after an NSTextFieldCell that will display a string value of the object, as well as let the user edit it. I can successfully add the NSTextFieldCell using the code below, but it is not editable. NSTextFieldCell *textField = [[NSTextFieldCell alloc] init]; [textField setFont:[NSFont fontWithName:@"Helvetica

View and Cell based NSTableView

◇◆丶佛笑我妖孽 提交于 2019-12-07 17:35:11
问题 What is the main difference between cell based and view based tableviews in Cocoa. The understanding I have is cell based tableviews are basically used for displaying strings and view based are for custom cells.User events such as dragging rows, selection etc can be handled in view based. cell based tableviews use objectValueForTableColumn: method and view based tables use viewForTableColumn: method. Is my understanding correct?. Or is any other design concerns between these table views. When

Realm + NSTableView + NSArrayController

流过昼夜 提交于 2019-12-07 16:50:17
问题 i have some Problems with my macOS Application and hope you can help me. Im pretty new on macOS so please be nice ;) A part of the app consists of a simple NSTableView which content is binded to an NSArrayController. The NSArrayController is feeded from a realm database. As you can see there is a checkbox for each row, which should set the bool value in the realm object. The bindings are ok, so if I mark/unmark the checkbox it seems to try writing on the realm object. But since realm needs a

NSButton in NSTableCellView: How to find desired objectValue?

家住魔仙堡 提交于 2019-12-07 10:06:54
问题 I have a view-based NSTableView that is populated through bindings. My textFields & imageViews are bound to the NSTableCellView's objectValue's properties. If I want to have an edit/info button in my NSTableCellView: Who should be the target of the button's action? How would the target get the objectValue that is associated with the cell that the button is in? I'd ultimately like to show a popover/sheet based on the objectValue. 回答1: Your controller class can be the target. To get the object

NSButtonCell in NSTableView: click handling

倖福魔咒の 提交于 2019-12-07 09:08:38
问题 I set NSButtonCell as a cell type in a Table Column in my NSTableView . I implemented an IBAction method, but I can't wire it with NSButtonCell in IB - the wire don't want to highlight a button from NSTableView . How to connect a method with NSButtonCell ? Or maybe there'se another way to handle its click event? Thanks 回答1: You should be able to wire up a connection from the cell by control+dragging to any object in your NIB. Just make sure the cell is actually selected, and that your action

Layer-backed NSView animation

做~自己de王妃 提交于 2019-12-07 08:57:04
问题 I have a certain NSView that I want to animate, but that NSView has a NSTableView inside which does not display correclty when the view is layer-backed (which in turn is nececessary to animate a view). So my answer was to make the view layer-backed right before animating, and then when the animation was done remove the layer, like this: [animatingView setWantsLayer: YES]; [NSAnimationContext beginGrouping]; [[animatingView animator] animateSomething]; [[NSAnimationContext currentContext]