Filling an NSMatrix and displaying it.

flor

Registered
Suppose, i have an array filled with NSImages . Now i would like to display all these images in a view (or a matrix) in the way iPhoto does. Do i have to subclass NSMatrix, or just subclass NSView? The purpose is that i can select each image, so i think NSMatrix is needed. But i have no clue on how to fill the matrix an DISPLAY my images on screen. (The images are all the same size)

I find no examples of this at all, so help would be muchos appreciated!!!
 
Basically, you can either instantiate NSImageCells yourself and stuff them into an NSMatrix, or set NSImageCell as the cellClass of an NSMatrix(or your own subclass) and grab the ones that it instantiates for you. Either way, you just use setImage: to set the image of the NSImageCell. If you're planning what I think you are, you'll definitely need an NSMatrix subclass, since NSMatrix doesn't flow cells automatically.
 
Back
Top