On Aug 12, 2008, at 00:49, Georg Seifert wrote:

I have a big document view. On it I place some small subviews. I f I scroll the document view, the subviews should move with it but only till it reaches the edge of the visible area of the main view.

e.g: if i move the main view down, and the subview hits the scrollbar, it should stick there.

is there a sane way of achieving this or do I better lock for an other behavior?

It's fairly easy to do. Register to receive bounds-changed notifications from your document view's clip view -- what the documentation calls the scroll view's content view, actually the parent view of your document view -- and also tell the clip view to post these notifications, since it doesn't do that by default.

When you receive the notification, you can use the document view's visibleRect (which is the clip view bounds, but in the document view's bounds coordinate system) to work out whether and where to move the subview.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to