Skip navigation.
 
mlRe: Scrollers on custom view appearing but not disappearing
FROM : Kyle Sluder
DATE : Sat Mar 01 18:37:16 2008

On Fri, Feb 29, 2008 at 7:00 PM, Steve Weller <<email_removed>> wrote:
>  I have a custom view into which I can draw a background color and a
>  centered rectangle. As the window is resized, the rectangle stays
>  centered and is clipped when the window gets small.
>
>  I want to define a canvas size slightly bigger than the rectangle and
>  have the scrollers appear when the available space is less than the
>  canvas needs. I override setFrameSize to do this:


FWIW, I've always thought the proper way to do this is to subclass
NSClipView, but I've never gotten it to work quite right, so I've
implemented it as you describe.  By redrawing the view so that your
contents are centered based on the scroll view, you eliminate the clip
view's ability to copy the image around.

Perhaps this would make a nice Cocoa sample project...

--Kyle Sluder

Related mailsAuthorDate
mlScrollers on custom view appearing but not disappearing Steve Weller Mar 1, 01:00
mlRe: Scrollers on custom view appearing but not disappearing Quincey Morris Mar 1, 01:46
mlRe: Scrollers on custom view appearing but not disappearing Steve Weller Mar 1, 03:10
mlRe: Scrollers on custom view appearing but not disappearing Quincey Morris Mar 1, 03:40
mlRe: Scrollers on custom view appearing but not disappearing Quincey Morris Mar 1, 04:31
mlRe: Scrollers on custom view appearing but not disappearing Steve Weller Mar 1, 06:31
mlRe: Scrollers on custom view appearing but not disappearing Quincey Morris Mar 1, 07:33
mlRe: Scrollers on custom view appearing but not disappearing Steve Weller Mar 1, 17:57
mlRe: Scrollers on custom view appearing but not disappearing Kyle Sluder Mar 1, 18:37