Re: NSTextView unselects on tab clicks...
Re: NSTextView unselects on tab clicks...
- Subject: Re: NSTextView unselects on tab clicks...
- From: jgo <email@hidden>
- Date: Tue, 3 Jul 2001 10:45:36 -0700
>
Brian Webster <email@hidden> Thu, 2001-06-28 19:10:48 -0500
>
> On Thursday, 2001 June 28 at 15:43 someone 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:.
And what if it's set up like this
+-------------------------------+ +------+ +--------+ +-------+
| | | \/ \/ \-------+
| | | |
| NSTextView | | tab view |
| | | |
+-------------------------------+ +-------------------------------------
You have some text selected in the text view and want what you do in
the various tab views to apply to what you have selected. Which tab
view you have shouldn't have any affect on what/whether you have text
selected in the text view. Even if you have an editable text box of
some sort in one of the tab views, that's just another, different
selection and should not drop the current selection in the text view.
John G. Otto Nisus Software, Engineering
www.infoclick.com www.mathhelp.com www.nisus.com software4usa.com
EasyAlarms PowerSleuth NisusEMail NisusWriter MailKeeper QUED/M
Will program Macs for food.