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: scrolling and drawing porblems




On Nov 7, 2006, at 10:26 PM, Ivan Kourtev wrote:

On Nov 7, 2006, at 4:11 PM, m wrote:
Then you'll probably need to do something like let the scroll view copy on scroll, then in your view's drawRect: method, draw "outside the lines" of the rect you get as a peramter. Basically redraw where your static stuff was before scrolling and where it should be after.

Unfortunately, that doesn't work for two reasons:

1. I don't know what the scroll was, in fact I don't even know whether drawRect was called because of a scrolling action. Maybe I can setup some complex logic in my view do find out whether the visible rectangle has changed but I am trying to avoid this if possible.
2. Drawing outside the drawRect's argument seems to have no effect - I think maybe the drawing gets clipped?

Yes, the AppKit sets up a clip rectangle that clips away everything that is outside of the dirty rect which is passed to -drawRect. You would need to override the -wantsDefaultClipping method and return NO from it in order to get rid of this default behavior.


However, there may be a different way to solve your problem. You could try to draw your static content into an overlay window which you attach to your document window. In theory it should be sufficient to create an NSWindow with the proper size and add that as a child window to your document window. Then draw the static content into the overlay window and the scrollable content into the regular window. Should work in theory, though I've never tried it.


Regards,

Dietmar Planitzer

_______________________________________________
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
References: 
 >Re: scrolling and drawing porblems (From: Erik Buck <email@hidden>)
 >Re: scrolling and drawing porblems (From: Ivan Kourtev <email@hidden>)
 >Re: scrolling and drawing porblems (From: m <email@hidden>)
 >Re: scrolling and drawing porblems (From: Ivan Kourtev <email@hidden>)
 >Re: scrolling and drawing porblems (From: m <email@hidden>)
 >Re: scrolling and drawing porblems (From: Ivan Kourtev <email@hidden>)
 >Re: scrolling and drawing porblems (From: m <email@hidden>)
 >Re: scrolling and drawing porblems (From: Ivan Kourtev <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.