• 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
Re: enhancing NSTextView for optionally-hidden text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enhancing NSTextView for optionally-hidden text


  • Subject: Re: enhancing NSTextView for optionally-hidden text
  • From: Ross Carter <email@hidden>
  • Date: Wed, 21 Nov 2012 10:25:46 -0500

> Nov 21, 2012, at 2:26 AM, Quincey Morris <email@hidden> wrote:
>
>> On Nov 20, 2012, at 21:03 , Kurt Bigler <email@hidden> wrote:
>>
>>> Given how this view is used, for appending only in the style of an uneditable text log permitting user selections and Copy, the easiest way I can think to implement it is to maintain two text views, one with hidden text included, and one without, and simply swap the two views to implement show/hide of hidden text.
>>>
>>> Is there a better way?  I would rather not get deep into a highly-structured text document kind of model in order to achieve something like this (assuming that even helps).
>>
>> Perhaps better than two views would be two attributed string properties (of the object that knows when the log changes). In one, you'd either mark the hideable text with the (unique?) attribute that indicates the hideability in the display, or with an custom attribute.
>

The way to do this is by subclassing NSGlyphGenerator to return null glyphs for text that has your custom Hidden attribute. A WWDC video from a few years back shows how.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: enhancing NSTextView for optionally-hidden text
      • From: Kyle Sluder <email@hidden>
References: 
 >enhancing NSTextView for optionally-hidden text (From: Kurt Bigler <email@hidden>)
 >Re: enhancing NSTextView for optionally-hidden text (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Does UIStoryboard know how to find the ~ipad version automatically?
  • Next by Date: Re: enhancing NSTextView for optionally-hidden text
  • Previous by thread: Re: enhancing NSTextView for optionally-hidden text
  • Next by thread: Re: enhancing NSTextView for optionally-hidden text
  • Index(es):
    • Date
    • Thread