Re: NSTokenField, how to query the selection?
Re: NSTokenField, how to query the selection?
- Subject: Re: NSTokenField, how to query the selection?
- From: Tim Gogolin <email@hidden>
- Date: Tue, 2 May 2006 15:57:53 -0500
On May 2, 2006, at 2:08 PM, Tim Gogolin wrote:
How do I get the current selected range of a NSTokenField?
Use -[NSWindow fieldEditor:forObject:] to get its field editor.
Then you can get the selected range from the field editor.
Nick Zitzmann
<http://www.chronosnet.com/>
Thanks for the reply, Nick. Would that it were so.
But fieldEditor:forObject: seems to return a field editor that has no
knowledge of TokenFields at all. A little grepping of the web seems
to point at +[NSTokenFieldCell _sharedFieldEditor] as an undocumented
way to actually get the field editor that is actually being used.
Calling selectedRange: on that object gets me a range that makes
sense... (each token basically counts as "one letter" in the selected
range).
So I guess I've solved my problem... but there's a reason people
don't document some interfaces... Sigh.
Does anyone know a better supported way to do this?
--
Tim Gogolin
Adobe Systems
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden