nsmatrix

Creating NSMatrix of NSImageCells

I need to create an NSMatrix with NSImageCells bound to an array controller. So the content of the NSMatrix is bound to an NSArray (so there are as many NSImageCells in the matrix as there are objects in the array), then the image path of the NSImageCells are bound to a key called "iconPath" in the Array Controller. And then when an ima...

Creating an NSMatrix programmatically, Snow Leopard

I'm trying to create an NSMatrix of an NSImageCell prototype programmatically (if you can help me doing it via Interface Builder, be my guest at answering me here) I created a new, empty project. In it, a normal object (subclassing NSObject) has this code (and only this code): - (void) awakeFromNib { NSRect f = view.bounds; NSM...

Getting the current state of NSButtonCell in an NSMatrix

Hi. I'm using an NSMatrix as a keypad and calling: [selectedCell setEnabled:NO]; [selectedCell setTransparent:YES]; when a key is selected (to prevent the same operation being performed again). However, I'd also like the option of 'flipping' the entire selections when done -- that is, replacing all the deleted cells and hiding the rem...

How can I convert this C Calendaer Code into a Objective-C syntax and have it work with matrixes

#define TRUE 1 #define FALSE 0 int days_in_month[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; char *months[]= { " ", "\n\n\nJanuary", "\n\n\nFebruary", "\n\n\nMarch", "\n\n\nApril", "\n\n\nMay", "\n\n\nJune", "\n\n\nJuly", "\n\n\nAugust", "\n\n\nSeptember", "\n\n\nOctober", "\n\n\nNovem...

UIKit controls for a sudoku grid?

I've recently completed an algorithmic sudoku solver in C, one in which three different approaches are taken to solve the puzzle. It was a piece of code I wrote for a Project Euler solution. Quite a bit of fun, I might add... Anywho, so I'm really interested in getting this little solver into an iPhone app. I really am at a loss for wha...

NSMatrix NSButtonCell AttributedTitle Wordwrap

Hello All, I am having an issue that is perplexing me. I have a NSMatrix using NSButtonCells to display a series of checkboxes. Because the Text is RTF I have to set AttributedTitle instead of Title. But even with wordwrap set to true it will only wrap Title and never does it to AttribtuedTitle. Has anyone out there ever dealt with thi...

Interface Builder Bug?

I have a cocoa program that I have I am writing on a 10.6 system, but targeting to 10.5. On the 10.6 system, it works fine. However, when I run it on the 10.5 machine, I get: The sender of menu item actions is now the NSMenuItem, not an NSMatrix. A menu item action method appears to be trying to send the NSMatrix method 'acc...

Hillegass: Cocoa Prog 3rd Ed: Ch. 33 on OpenGL: Where's the Matrix?

I'm using XCode 3.1.4, on OSX 10.5, targeting same. In Ch. 33 we're asked to drag an NSOpenGLView and an NSSlider onto the IB library, and then do Layout -> Embed Objects in -> Matrix. Except the Matrix option is always disabled. What do I have to do to enable the matrix? ...

Passing array of custom objects to NSCell in NSMatrix programatically

I have an NSArray of custom NSObjects. Each object has some properties and an image that I would like to display in a grid view. NSMatrix appears to be a good solution to my problem, but I am having issues getting the content of the objects to display. Couple of things to note. I am not using core data I am trying to do this programm...

Showing image before text in NSButtonCell in NSMatrix

Hi all, I am displaying buttons in NSMatrix. My requirement is: to change color of button title and place an image at beginning of title, when certain condition is satisfied. To do so, I used following code: // setting attributed text NSAttributedString *selectedCellAttribute; NSFont *selectedCellFon...