[Wrap-up] Re: Equivelent to drawRect: for drawing after sub views are drawn
[Wrap-up] Re: Equivelent to drawRect: for drawing after sub views are drawn
- Subject: [Wrap-up] Re: Equivelent to drawRect: for drawing after sub views are drawn
- From: George Lawrence Storm <email@hidden>
- Date: Thu, 7 Oct 2004 11:15:30 -0700
Wrap-up to my earlier post(s)
I need to perform the equivalent to NSView's drawRect:, however I
need it to be called AFTER its sub views are drawn.
Is there a method I can override for such a purpose?
I need to draw a transparent overlay & some guidelines which will
overlap some of those sub views.
I decided to live dangerously and overrode the following undocumented
method in my NSView:
- (void)_recursiveDisplayAllDirtyWithLockFocus:(BOOL)fp8
visRect:(struct _NSRect)fp12
{
[super _recursiveDisplayAllDirtyWithLockFocus:fp8 visRect:fp12];
[self lockFocus];
[self drawPostRect];
[self unlockFocus];
}
my drawPostRect: being where I draw my overlays
region to that of only the visible rect. This creates a problem when
the view is in a scroller, in that my drawPostRect: is being clipped
to the visible rect unlike the drawRect: which is clipped to the
scrolling view.
I found that I have to call [myScrollView setDrawsBackground:NO];
during one of my awakeFromNib's to eliminate the clipping problem.
-----
Based on this little experiment it seems that adding a "drawPostRect:"
method (with it being passed a NSRect and the ability to call
getRectsBeingDrawn:count: and needsToDrawRect: the same as drawRect:)
would be of benefit. Alternatively if the private method I am
overriding could be made public and properly documented it would be
appreciated.
It now appears to be working reliably, I will submit this as a feature
request.
-----
George Lawrence Storm
Macintosh Applications Development
Snohomish (Seattle), Washington
E-mail: <email@hidden>
_______________________________________________
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