Re: Controlling selection in NSTextFields
Re: Controlling selection in NSTextFields
- Subject: Re: Controlling selection in NSTextFields
- From: "Erik M. Buck" <email@hidden>
- Date: Sat, 10 Nov 2001 19:50:38 -0600
>
Anyway, why is it called a "field editor" in some contexts and a
>
"text object" in others? Just to trip me up? :-)
Text objects are used for lots of things. The field editor is a text object
shared by (usually) all of the text fileds in a window and used to support
editing fields. All field editors are text objects but not all text objects
are field editors.
You are attempting something pretty complex. I highly recommend that you
read about field editors before continuing. There is lots of documentation
and well documented ways of using your own custom filed editor for a
particular control.
>
>
I also tried to implement:
>
- (void)mouseUp:(NSEvent*)theEvent
>
in my NSTextField subclass, this would of course allow me to check
>
the selection after the user finishes messing around with it, but it
>
turns out mouseUp is not called on a mouse click. The NSView docs
>
just mention mouse-down events, never mouse-up events; I at first
>
supposed they're disabled by default as they were in previous Mac
>
OS's, and needed to be turned on by some obscure API.
>
I have never tried what you are attempting. Have you considered using
multiple different text fields. Make some of them non-editable. The user
will only be able to place the cursor in the editable fields.