FROM : Steve Weller
DATE : Sat Mar 01 17:57:06 2008
On Feb 29, 2008, at 10:33 PM, Quincey Morris wrote:
> A couple of small points:
>
> -- It's not quite correct to use the superview's frame to calculate
> a view's frame, since they are in different coordinate systems. You
> really should use [[self superview] bounds], which is in the same
> coordinate system as [self frame].
>
> The problem is harmless in this case, because the superview is a
> NSClipView, which happens to keep its frame coordinate system
> synchronized with that of view it contains, but this is not
> generally true of view-superview geometry.
>
> -- If you want to refer to the clip view, [[self
> enclosingScrollView] contentView] is more correct than [self
> superview]. The fact that they're the same thing is an
> implementation detail. (But if you're going to pretend not to know
> they're the same you really should do an explicit coordinate
> conversion when combining their dimensions.)
>
> -- As someone suggested on this list a few weeks ago, it's perhaps
> marginally more elegant to use [self visibleRect] instead of the
> clip view bounds. Although the purpose of the clip view is to manage
> the visible rect of the view it contains, using the visible rect
> directly means you don't have to build in knowledge of that
> implementation detail. And there's no coordinate conversion needed.
Thank you. All very helpful information. I have incorporated the
changes, added origin offsetting to keep things central, and it works
perfectly. The last change I made was to manually send the
notification once the content parameters were set up. That ensured
that the scrollers appeared when the window was first created.
--
Blog: Photos: <A href="http://bagelturf.smugmug.com/">http://bagelturf.smugmug.com/
DATE : Sat Mar 01 17:57:06 2008
On Feb 29, 2008, at 10:33 PM, Quincey Morris wrote:
> A couple of small points:
>
> -- It's not quite correct to use the superview's frame to calculate
> a view's frame, since they are in different coordinate systems. You
> really should use [[self superview] bounds], which is in the same
> coordinate system as [self frame].
>
> The problem is harmless in this case, because the superview is a
> NSClipView, which happens to keep its frame coordinate system
> synchronized with that of view it contains, but this is not
> generally true of view-superview geometry.
>
> -- If you want to refer to the clip view, [[self
> enclosingScrollView] contentView] is more correct than [self
> superview]. The fact that they're the same thing is an
> implementation detail. (But if you're going to pretend not to know
> they're the same you really should do an explicit coordinate
> conversion when combining their dimensions.)
>
> -- As someone suggested on this list a few weeks ago, it's perhaps
> marginally more elegant to use [self visibleRect] instead of the
> clip view bounds. Although the purpose of the clip view is to manage
> the visible rect of the view it contains, using the visible rect
> directly means you don't have to build in knowledge of that
> implementation detail. And there's no coordinate conversion needed.
Thank you. All very helpful information. I have incorporated the
changes, added origin offsetting to keep things central, and it works
perfectly. The last change I made was to manually send the
notification once the content parameters were set up. That ensured
that the scrollers appeared when the window was first created.
--
Blog: Photos: <A href="http://bagelturf.smugmug.com/">http://bagelturf.smugmug.com/
| Related mails | Author | Date |
|---|---|---|
| Steve Weller | Mar 1, 01:00 | |
| Quincey Morris | Mar 1, 01:46 | |
| Steve Weller | Mar 1, 03:10 | |
| Quincey Morris | Mar 1, 03:40 | |
| Quincey Morris | Mar 1, 04:31 | |
| Steve Weller | Mar 1, 06:31 | |
| Quincey Morris | Mar 1, 07:33 | |
| Steve Weller | Mar 1, 17:57 | |
| Kyle Sluder | Mar 1, 18:37 |






Cocoa mail archive

