Reputation: 145
I'm a newbie. I have a problem with NSMatrix. I created mutiple NSMatrix but i want first loading, they not checked. I used this code to created them but it always checked.
prototype= [[NSButtonCell alloc] init];
[prototype setTitle:@""];
[prototype setButtonType:NSRadioButton];
NSRect matrixRect = NSMakeRect(400, textfield_Y, 50, 20);
myMatrix = [[NSMatrix alloc] initWithFrame:matrixRect
mode:NSRadioModeMatrix
prototype:(NSCell *)prototype
numberOfRows:1
numberOfColumns:1];
[myMatrix setTag:300+i];
//[myMatrix setAction:@selector(radioButtonClicked:)];
[myMatrix setTarget:self];
NSArray *cellArray = [myMatrix cells];
[[cellArray objectAtIndex:0] setTag:0];
[guiView addSubview:myMatrix];
[prototype release];
[myMatrix release];
Any ideas? Thanks a lot
Upvotes: 1
Views: 1266
Reputation: 2947
On an NSButtonCell you would use the setState
method of NSCell
:
[prototype setState:NSOffState]
Upvotes: 2