I've been trying to create a calendar matrix of days which are clickable to select a day in the month. It's a something of a classic example of using NSMatrix from what I've read but I'm trying to use bindings to hook it up.

I am using an NSArrayController holding an array of NSButtonCell's which is connected as the NSMatrix's content. I set the bindings on the NSMatrix's NSButtonCell prototype connecting the target to my controller object (to select the day) and also the enabled attribute to the NSButtonCell's isEnabled attribute.

The NSArrayController is populated with NSButtonCell's that I create with the correct date placement, etc, using copies of NSMatrix's prototype.

When the app runs, the bindings on the button cell instances in the matrix don't seem to be observed, that is, button presses aren't forwarded to the target and the enabled attribute is ignored. If I set the bindings on the button cells within the NSMatrix directly (ie, not using the protoype), they are observed.

I don't quite get what I'm doing wrong. Should I be creating my array of button cells using something other than copy to pick up the bindings? Should I be asking the array controller to create the button cell instances? Is there something that's not working in the NSMatrix prototype? Or am I misunderstanding some concept?

Thanks,

        Ben.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to