Questions tagged [nscollectionviewitem]

101 questions
0
votes
3 answers

How do you instantiate a NSCollectionViewItem from main Storyboard for use in a collectionView

I have a Storyboard that contains a controller with a NSCollectionView. The Storyboard also contains a NSCollectionViewItem with outlets connected to NSCollectionViewItem subclass, FeedItem. How do you use the the "cell" or "scene" from the…
seanbehan
  • 1,463
  • 15
  • 23
0
votes
1 answer

NSCollectionView, imageview rotation issue

I have NSCollectionView with items inside. I have xib for NSCollectionViewItem, with binding to representedObject.image My issue is following. Sometimes my items should display "Empty image", till I pick image for that, through my controls. When I…
PolosatiyVjih
  • 269
  • 3
  • 12
0
votes
1 answer

Get stringvalue of NSTextField within a NSCollectionView

I would like to know how I can get the stringvalue of a textfield thats in a NSCollectionView. The textfield is created with a prototype for the collectionview. I dont know if I should use representedObject or something else and how.
0
votes
0 answers

Cocoa Binding NSButton change the target for binding

I have a NSButton(provided delete item action) in the NSCollectionViewItem, the argument is set successfully the binding actions is responded and I also got the representedObject. But the target I m binding is the file's owner here is the method i…
0
votes
1 answer

Rounded corners of NSCollectionViewItem

Simple question, but I can't find any answers... How I can change corner radius of NSCollectionViewItem instance?
Artem Novichkov
  • 2,356
  • 2
  • 24
  • 34
0
votes
1 answer

How to properly show the current selection in an NSCollectionView?

I have an NSCollectionView that is showing some images. I have implemented an NSCollectionViewDelegate to tell it which items should be selected and/or highlighted. I'm using a stock NSCollectionViewItem to draw the images and their names. When the…
user1118321
  • 25,567
  • 4
  • 55
  • 86
0
votes
2 answers

NSCollectionViewItem selection on NSImageView, border around image with CALayer

I have a NSCollectionViewItem with NSImageView in it. I want to have a shadow around the image. Once it is selected, I want the image to have shadow and a border. Currently, NSImageView gets a border around the image. How can I achieve shadow +…
0
votes
1 answer

NSCollectionView select items for segue in OS X

I have looked at the NSCollectionView API and I havnt found anything matching certain tutorials I have seen. Xcode forces me to write my method like this so that there are no errors: @objc(collectionView:didSelectItemsAtIndexPaths:) func…
0
votes
0 answers

How to place JSON data in a NScollectionview

I am grabbing data from a url which is a PHP script that is JSON encoding my data from a MySQL database. My data is coming into my app and I know how to parse it but I am unsure how to place my data inside of each item's textField.stringvalue in my…
0
votes
3 answers

Custom control in NSCollectionViewItem

I want to put a custom control inside the view for my NSCollectionViewItem. Lets say I have a custom NSView called BoxesView.BoxesView is just a view that draws a predetermined number of boxes in its view. That number of boxes is set in the init…
Randall
  • 14,691
  • 7
  • 40
  • 60
0
votes
1 answer

NSCollectionView selection and deselection

I recently got my NSCollectionView worked in the way, that it handles section the right way. I reached this by adding a binding with the Model Key Path "selected". This action hides a blue view, that shows a selection to the user. The Problem is,…
0
votes
1 answer

How to update NSCollectionViewItem when data model change?

I have a NSArrayController bound to a NSCollectionView. My data model is a class Person. Inside Person is a timer that will change the property age every second. In my NSCollectionViewItem I have a NSLabel bound to representedObject.age. When the…
TalkingCode
  • 13,407
  • 27
  • 102
  • 147
0
votes
1 answer

Get represented object in NSCollectionView Item View action

Here's what I have: An NSCollectionView Populated via an NSArrayController Each 'item' (NSCollectionViewItem) shows its content in an attached view This view contains an NSButton Now, the question: When the user clicks the button, how could I tell…
0
votes
1 answer

Click on NSCollectionView returns always the same object

I' ve a NSCollectionViewItem subclass, called MyItem used as item of my NSCollectionView. I need to enumerate all the item in my collection view to set the delegate for each item with this code: NSUInteger categoryNumber =…
Luca
  • 1,704
  • 3
  • 29
  • 42
0
votes
1 answer

Drawing issues after subclassing NSCollectionView

OK, here's what I have done: I have an NSCollectionView I wanted to be able to enable "selecting" items, and drawing a custom border when an items is selected I subclassed NSCollectionViewItem (to enable selection) I subclassed NSView for the…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223