• 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 unselects on tab clicks...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView unselects on tab clicks...


  • Subject: Re: NSTextView unselects on tab clicks...
  • From: Brian Webster <email@hidden>
  • Date: Thu, 28 Jun 2001 19:10:48 -0500

On Thursday, June 28, 2001, at 03:43 PM, cocoa-dev-
email@hidden wrote:

I have a window with an NSTextView and a tabbed area to tab through
different controls. When the user types in text, selects it, and clicks
a tab, the text becomes unselected. Its important that the user can
keep text selected while switching between different tabs, since those
tabs all modify the selected text, and its very annoying to have to keep
selecting the same text repeatedly.

I was thinking a solution would be to keep track of an NSRange, and
whenever anyone clicked a tab, i would reselect the NSRange.

This sounds like a pretty good solution, although there might be some way to have the text view maintain its selection, but I don't know what it is. I think the easiest way to implement this solution is to give your tab view a delegate and implement the tabView:willSelectTabViewItem: method and read the selection range from there, just before the user switches to another tab. You can then restore the selection in tabView:didSelectTabViewItem:.

--
Brian Webster
email@hidden
http://www.owlnet.rice.edu/~bwebster


  • Prev by Date: Intercept Option-Close?
  • Next by Date: Best way to enable/disable a control based on another control?
  • Previous by thread: Re: NSTextView unselects on tab clicks...
  • Next by thread: NSStringAdditions drawAtPoint
  • Index(es):
    • Date
    • Thread