Re: Q: The cursor position in TextView
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.