• 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: Partially select texts in NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Partially select texts in NSTextField


  • Subject: Re: Partially select texts in NSTextField
  • From: Nico <email@hidden>
  • Date: Tue, 13 Aug 2002 18:44:59 +0200

Well why not using :

[someTextField selectText:0];
[[someTextField window] fieldEditor:YES forObject:someTextField
setSelectedRange:someSelectionRange];

someSelectionRange is an NSRange.
You can create one using NSMakeRange().

Just a suggestion... Works fine for myself (I use that to set the insertion
point at the end of the text field)

Nico

On 13/08/02 18:16, "Tony S. Wu" <email@hidden> wrote:

> Sort of...
> I don't know how :P
> Quite new to Cocoa.
> Mind giving me more information??
>
> Tony S. Wu
> email@hidden
>
> "Nope, this world ain't perfect. But at least I know it's not because of
> me."
>
>
> Nico at email@hidden wrote:
>
>> Is there a reason you can't use field editor ?
>> Nico
>>
>> On 13/08/02 17:32, "Tony S. Wu" <email@hidden> wrote:
>>
>>> I posted this question in email@hidden before, got about 3 or 4
>>> replies.
>>> But none of them worked.
>>> And there wasn't follow-up anymore.
>>> So I thought I'd ask again.
>>> I want to be able to partially select texts in NSTextField.
>>> And there isn't any straight-forward way to do this.
>>> So can anyone tell me how?
>>> Or better yet support a link to a sample code?
>>> Thanks.
>> _______________________________________________
>> 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.
_______________________________________________
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:
    • Key pressed in NSTextField
      • From: "Tony S. Wu" <email@hidden>
  • Prev by Date: Printing for Document-based app
  • Next by Date: Re: [TRTFM] Cocoa and AppleScript
  • Previous by thread: Re: Partially select texts in NSTextField
  • Next by thread: Key pressed in NSTextField
  • Index(es):
    • Date
    • Thread