Re: Nubie question re Sketch behavior
Re: Nubie question re Sketch behavior
- Subject: Re: Nubie question re Sketch behavior
- From: "Erik M. Buck" <email@hidden>
- Date: Mon, 15 Oct 2001 20:11:40 -0500
>
I was less than specific as to what I was looking for. I see that
>
NSView has
>
setFrameSize which the user can call. Fine and I could use this.
>
On the otherhand In MacApp
>
the view has an overloaded method (CalcMinFrame()) in which the user may
>
specify a
>
way to calculate the new size of the view. The framework calls this
>
method at appropriate times
>
to update the view size, in this case, as the user adds objects and
>
drags them into empty places
>
to make an ever increasing canvas. I did not see something like this in
>
NSView. Does it exist?
>
No. It does not exist in NSView. That is hardly a behavior that every view
should inherit from NSView.
Inside Sketch you will fine a place in the code where objects are moved.
You will find a place in the code where objects are placed. In those
places, call a method called sizeToFitObjects.
You then need to write the sizeToFitObjects methods. Iterate over the
collection of objects accumulating their bounds. The set Sketch's view to a
frame large enough to enclose all of the objects.