Re: How do I select text inside an edit Unicode text control
Re: How do I select text inside an edit Unicode text control
Subject : Re: How do I select text inside an edit Unicode text control
From: Laurence Harris <email@hidden >
Date: Wed, 30 May 2007 21:52:21 -0400
Delivered-to: email@hidden
Delivered-to: email@hidden
On May 30, 2007, at 7:54 PM, Carlos Eduardo Mello wrote:
// textView is a static text control underneath inputView
CFStringref initialString;
ControlEditTextSelectionRec range;
initialString = HIViewCopyText( textView );
range.selStart = 0;
range.selEnd = CFStringGetLength( initialString );
err = HIViewSetText( inputView, initialString );
CFRelease(initialString);
err = SetControlData( inputView, kControlEntireControl,
kControlEditTextSelectionTag, sizeof(ControlEditTextSelectionRec),
&range );
This is what I do and it works without any further steps. If you want
to select all of the text you can just do this:
ControlEditTextSelectionRec range = { 0, 0x7FFF };
err = SetControlData( inputView, kControlEntireControl,
kControlEditTextSelectionTag, sizeof(ControlEditTextSelectionRec),
&range );
Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.