• 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: How to support clicks in a non-selectable NSTextView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to support clicks in a non-selectable NSTextView?


  • Subject: Re: How to support clicks in a non-selectable NSTextView?
  • From: Brian Webster <email@hidden>
  • Date: Mon, 8 Jul 2002 08:55:30 -0500

On Monday, July 8, 2002, at 12:03 AM, cocoa-dev-
email@hidden wrote:

so naturally, i am curious...=) is there some way that i can support
clicking in an NSTextView when it is not selectable? i would like my
users to not be able to select and/or copy the text within the view, but
still be able to click on URLs to access them. is that possible?

Anything is possible - the real question is, how hard is it? :)

There are two ways I can think of that you could go about it. The first would be to make the view not selectable and try to handle clicks on URLs yourself. This would mean making a subclass of NSTextView and overriding mouseDown: and mouseUp:, finding the bounding rectangles of the URLs via NSLayoutManager, etc. The second would be to set the selectable flag to YES but then disable everything you'd want to disable. You could make the text selection color the same as the background color so it wouldn't show up, override copy:, cut:, the drag routines, and so on.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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: How to support clicks in a non-selectable NSTextView?
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Re: ld: undefined symbol _main (but a main does exist)
  • Next by Date: Re: Receive an URL through my applications icon?
  • Previous by thread: Re: How to support clicks in a non-selectable NSTextView?
  • Next by thread: Re: How to support clicks in a non-selectable NSTextView?
  • Index(es):
    • Date
    • Thread