Re: Addressbook style textfield
Re: Addressbook style textfield
- Subject: Re: Addressbook style textfield
- From: Jeremy Dronfield <email@hidden>
- Date: Sat, 6 Mar 2004 11:48:25 +0000
On 6 Mar 2004, at 6:39 am, Andrew Kazmierski wrote:
What I still don't understand is how do you allow a single part of the
text view to be edited without allowing the other parts to be edited?
I'm probably missing something simple here...
No, you're missing something quite complex. It appears that the text
view overrides -mouseDown: and implements text view methods
-selectionRangeForProposedRange: and
-textView:willChangeSelectionFromCharacterRange:toCharacterRange: in
order to validate a selection whenever the user clicks in the view. In
other words, it has to establish whether the user clicked in a
non-editable portion of the view, clicked for the first time in an
editable area, or clicked for the second time in an editable area. It
then has to fix the selected range in order to draw the "raised"
effect.
Until Apple makes the sample code for this type of text view public
(which they surely will, since it's been leaking out via ADC TV)
mimicking this text view behaviour will remain a decidedly non-trivial
task.
-Jeremy
-----------------------------------------------------------
"The man who believes a thing is true because he feels it in his bones,
is not really very far removed from the man who believes it on the
authority of a policeman's truncheon." (E.M. Forster)
-----------------------------------------------------------
email@hidden
theLocustFarm.net:
- fractious fiction at
http://freespace.virgin.net/jeremy.dronfield
-----------------------------------------------------------
_______________________________________________
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.