Re: Custom NSView positioning inside a scrollview
Re: Custom NSView positioning inside a scrollview
- Subject: Re: Custom NSView positioning inside a scrollview
- From: Matt Neuburg <email@hidden>
- Date: Mon, 31 Jan 2005 08:43:58 -0800
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:
This email sent to email@hidden