Re: NSTextField mouse down event
Christiaan Hofman <[email protected]>
| Newsgroups | gmane.comp.macosx.devel |
|---|---|
| Message-ID | <[email protected]> |
On Feb 3, 2010, at 10:13, padmakumar wrote: > In my Cocoa based application, I am having a user editable NSTextField. > I need to know when the user selects the NSTextField using mouse. > I tried the delegate method controlTextDidChange, but the problem is user need to enter an character to get this delegate invoked. > My requirement was when ever user selects the NSTextField, I need to know that. > Any inputs on this will be helpful. > > Regards > Pappan I assume that you DON'T want to know when the user selects the textfield /using the mouse/, as that's almost always the wrong thing to do: there are many more ways to select a text field, and almost always, when you condition something on /how/ something happens rather than /what/ happens you're doing it wrong. So if you want to know when a text field gets selected (rather than when editing starts), I think you can only do that by subclassing NSTextFieldCell and overriding the appropriately named method. Christiaan