[Q] How can one programatically begin a text editing session in a NSTextField?
[Q] How can one programatically begin a text editing session in a NSTextField?
- Subject: [Q] How can one programatically begin a text editing session in a NSTextField?
- From: Eric Gorr <email@hidden>
- Date: Thu, 5 Feb 2009 10:54:06 -0500
The documentation at:
http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/TextEditing/Tasks/SetFocus.html#/
/apple_ref/doc/uid/20000933
seems to indicate that one just needs to do:
[theWindow makeFirstResponder: theTextView];
[theTextView setSelectedRange:NSMakeRange(0,0)];
However, upon closer inspection, this seems to only apply to a
NSTextView, not a NSTextField.
For example, NSTextField does not respond to the setSelectedRange
message.
But, when I call makeFirstResponder on my NSTextField, it does return
true, but an edit session is not started - I cannot type anything
which changes the text in the field.
Thank you.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden