• 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: Q: The cursor position in TextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: The cursor position in TextView


  • Subject: Re: Q: The cursor position in TextView
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 17 Sep 2001 23:22:18 -0700

On Monday, September 17, 2001, at 10:59 PM, Senovia von Perle wrote:

Thanks for your help... but my question was somewhat unspecific.
What I want to know is how to convert the Range to its components
(initialIndex, number)... as it were in intValue...

NSRange is a struct, consisting of:

typedef struct _NSRange {
unsigned int location;
unsigned int length;
} NSRange;

So, if you define an NSRange,

NSRange myRange;

you can refer to it's parts like you would any other C struct.

unsigned where = myRange.location;
unsigned howBig = myRange.length;

-jcr


Regards,
Senovia von Perle
On Monday, September 17, 2001, at 05:59 PM, Kenneth C. Dyke wrote:


On Monday, September 17, 2001, at 01:44 AM, email@hidden wrote:

Hi, there.

I want to know the method to know the position of cursor in TextView.

From NSText.h:

- (NSRange)selectedRange;

Always be sure to check the headers/documentation for the superclass.

-Ken

Kenneth Dyke, email@hidden (personal), email@hidden (work)
Sr. Mad Scientist, MacOS X OpenGL Group, Apple Computer, Inc.
C++ is to C as Lung Cancer is to Lung
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


"I fear all we have done is to awaken a sleeping giant and fill him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.


References: 
 >Re: Q: The cursor position in TextView (From: Senovia von Perle <email@hidden>)

  • Prev by Date: Re: Q: The cursor position in TextView
  • Next by Date: QuickDraw LockPixels on Mac OS X (was: Saving a series of BitmapReps as Quicktime)
  • Previous by thread: Re: Q: The cursor position in TextView
  • Next by thread: distributed processing ad multiThreading
  • Index(es):
    • Date
    • Thread