Skip navigation.
 
mlRe: deactivating an NSScrollView
FROM : Geoff Levner
DATE : Sat Apr 09 22:01:10 2005

On 9 Apr 2005, at 19:12, Shawn Erickson wrote:

>
> On Apr 8, 2005, at 8:57 AM, Geoff Levner wrote:
>

>> Can any Cocoa gurus out there tell me if there is a simple way to
>> "deactivate" an NSScrollView, that is, to make it behave as if the
>> document view were attached directly to the NSScrollView's superview?
>>  Our application displays a PDF image in a scrolled view, but
>> sometimes we would like for the image to resize itself to fill the
>> view rather than scrolling....

>
> NSScrollView has the ability to automatically turn the scroll controls
> off if they sense that the document view has a size in relation to the
> content view that doesn't require the scroll controls. I believe it
> should be as easy as resizing you document (possibly adding it again
> to the scroll view) and having automatic scrolling turned on (or
> explicitly turning them off).
>
> Review NSScrollView's setHasHorizontalScroller:,
> setHasVerticalScroller:, and setAutohidesScrollers: methods.


Hiding the scrollers doesn't change the behavior of the scroll view: it
just makes it impossible for the user to scroll...

And yes, I can resize the document, but in the case at hand I would
like for it to be resized automatically when the window is resized.

Geoff

Related mailsAuthorDate
mldeactivating an NSScrollView Geoff Levner Apr 8, 17:57
mlRe: deactivating an NSScrollView Geoff Levner Apr 9, 18:45
mlRe: deactivating an NSScrollView Shawn Erickson Apr 9, 19:12
mlRe: deactivating an NSScrollView Geoff Levner Apr 9, 22:01
mlRe: deactivating an NSScrollView Hamish Allan Apr 10, 04:30