NSMatrix to window

Hi,

I’ve been reading the NSMatrix document and it seems interesting. I’m not sure how to get it in the window. Do I use a table view? Do I have to do something like:

I can’t find matrix in Xcode’s Object Library.

Edited: btw, I think I know how to allocate and init. Just how to get the matrix to the window?

Edited: in the back of my mind, I’m thinking that someone showed a similar example to me but I can’t remember. Maybe it was the menu example.

Edited: I think I found it. I need to use an NSBox?

Edited: now I think I might need to make a NSView instead. Getting confused. :slight_smile:

Thanks,
kel

Hi,

to create an NSMatrix object programmatically use one of the methods beginning with initWithFrame.
to create an NSMatrix object in IB connect it to a property like other UI elements

NSMatrix is a subclass of NSView

Hi Stefan,

I understand the first part, but what do you mean connect it to a property. There is no property of window, so whose property?

Thanks,
kel

Maybe tomorrow I’ll wake up and understand what you said in the second part.

Good night,
kel

normally you define a property in the script class e.g.

property myMatrix : missing value

then connect the NSMatrix instance in Interface Builder to this property.

Reference chains like in AppleScript Studio are not needed in ASOC

I think I’ve got it now Stefan. Thanks. Gotta try it out tomorrow.

Later,
kel

Hi Stefan,

I can’t find a NSMatrix in Interface Builder.

In the Object Library it’s called Radio Group

Hi Stefan,

Ok, got that.

Edited: Just found a couple of posts I responded to 7 years ago, about matrix and radio groups. I thought radio group sounded familiar.

Thanks a lot,
kel