• 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: NSTextView with custom space width
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView with custom space width


  • Subject: Re: NSTextView with custom space width
  • From: Michael Dautermann <email@hidden>
  • Date: Thu, 21 Apr 2011 06:35:12 -0400

On Apr 18, 2011, at 5:37 AM, Дмитрий Николаев wrote:

> Hi to all!
>
> I need to implement custom separator with custom width between two part of paragraph in text view:
>
> AAAA AA A      BBB BBBBB B
>
> This is separator must be included as non-editable character. So user can't delete it or modify.
> I understand, that i must overload standard behavior of textview in some points (for example, when user press "delete" right after separator nothing will be deleted)

The potential user interface you're describing sounds quite scary.  Are you certain the end result is going to make sense to customers?

But anyways, to get to where you want to be, look at the [NSTextViewDelegate textView: shouldChangeTextInRange: replacementString:] method or -- since you're likely to be subclassing NSTextView in order to do custom drawing of whatever character / thing you're going to use as a separator -- you can also look at [NSTextView shouldChangeTextInRange: replacementString:].

If these methods are called and the range crosses your "non-editable" character, you can return NO and disallow the user from deleting anything that includes that separator.

m


_______________________________________________

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: NSTextView with custom space width
      • From: Ross Carter <email@hidden>
References: 
 >NSTextView with custom space width (From: Дмитрий Николаев <email@hidden>)

  • Prev by Date: Re: UI Design on iPad
  • Next by Date: Re: Does not allow to Uninstall the application when it is running.
  • Previous by thread: NSTextView with custom space width
  • Next by thread: Re: NSTextView with custom space width
  • Index(es):
    • Date
    • Thread