On 4 Apr 2012, at 2:20 PM, Peter Teeson wrote:

> Given a 3 x 3 Matrix which is a sub-class of NSMatrix with Cells sub-classed 
> from NSButton 
> the X origins of column 0 cells seem to be 1.0 point inside the Matrix bounds.
> 
> So if I want to stroke the Matrix bounds with a line width of e.g. 4.0 points
> it draws over the left area of the column 0 cells.
> 
> Hence I would like to make sure that the origins of the cells are where I 
> want them to be, i.e. leave enough room to stroke the Matrix bounds.
> 
> I've read Matrix Programming Guide and looked at the NSMatrix and NSCell
> references but I do not understand which methods to use to accomplish this.
> 
> Should I do this in NSCell calcDrawInfo? And then does that mean for each 
> Cell?
> Surely there must be simple way to provide a frame for all the Cells inset 
> from the bounds of the Matrix.
> 
> Nor can I find a way to do this in Interface Builder.
> AutoLayout is checked but Automatically Resizes Cells is not.

I read the NSMatrix class reference to say that NSMatrix enforces its frame 
being the hull of the cells plus the intercell spacing. You won't accomplish 
you want, in the way you propose, without fighting the framework.

Why not embed the matrix in a view of your own? You can then draw whatever you 
like around it.

        — F


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to