Re: scrolling and drawing porblems
Re: scrolling and drawing porblems
- Subject: Re: scrolling and drawing porblems
- From: Dietmar Planitzer <email@hidden>
- Date: Tue, 7 Nov 2006 22:59:43 +0100
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:
This email sent to email@hidden