Where To drawRect?
Where To drawRect?
- Subject: Where To drawRect?
- From: J Nozzi <email@hidden>
- Date: Tue, 18 May 2004 15:13:32 -0400
List:
I'm attempting to add a 'feature' (spelled 'sinful hack') to an
NSTextView subclass of mine. I want to indicate the textview is
uneditable with an alpha-faded gray (or user-selected color) custom
view / NSBezierPath that covers the entire text of the textview.
The reason I'm using a custom view and not the textview's background
color is because the bg and fg color are user-configurable for comfort
while reading/editing.
I want users to see that it's very obviously an uneditable copy but
still be able to select the text. I use the hitTest method to let
clicks 'fall through' to the textview, but the problem arises when I
begin to scroll. The custom view does not cover the entire text when
scrolling and misbehaves (does not redraw) when you scroll back.
I've tried adding this view to various pieces of the whole textview /
scrollview assembly, but nothing seems to work as expected. I *know*
I'm missing the obvious somewhere - I'm really good at that.
So to what superview do I attach this custom view to have it cover
the entire text, regardless of scrolling -- preferably efficiently
(with no flicker during the scroll)?
- J
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.