Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom NSView positioning inside a scrollview



On Mon, 31 Jan 2005 10:20:37 +0100, Giuseppe Alletti
<email@hidden> said:
>I have a custom NSView inside a NSScrollView, and I want it to assume
>this behaviour regarding posizioning:
>
>- when the window (and so the scrollview) is larger than the custom
>view, I want it centered inside the scrollview;
>- when the window width is less then the custom view width, I want
>normal scrollview behaviour for orizontal scrolling;
>
>Should I 
>proceed programmatically?

Yes. Register for NSViewFrameDidChangeNotification and set the scroll view
to post this notification (setPostsFrameChangedNotifications). Now you will
get a notification constantly during resizing and can manipulate the clip
view bounds to put the material where you want it. Some of the
responsibility for positioning may be shared by your drawRect. m.

-- 
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.