• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Where To drawRect?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Where To drawRect?
      • From: Brian Smith <email@hidden>
  • Prev by Date: Re: Type of iPod
  • Next by Date: Re: better image scaling?
  • Previous by thread: Re: [ANN] Subversion Manager v1.0 for OS X
  • Next by thread: Re: Where To drawRect?
  • Index(es):
    • Date
    • Thread