RE: Modal Window for NSTextField
RE: Modal Window for NSTextField
- Subject: RE: Modal Window for NSTextField
- From: Dany Golubitsky <email@hidden>
- Date: Tue, 03 Jan 2012 04:29:44 -0500
- Acceptlanguage: en-US
- Thread-topic: Modal Window for NSTextField
Hello again.
I am sorry, I am new to Cocoa and some things that looks completely obvious to you are completely unknown to me.
(controlTextDidEndEditing: notification) - What is this function, where should it be implemented, who should call it?
How need I start the TextField?
For my code I need to call opening function, wait for it to open, get text from user and return. Meaning:
{
Block 1
}
Calling for TextField and waiting for return value.
{
Block 2
}
Getting return value in some other place is not an option.
Is there any example of this?
Thanks!
-----Original Message-----
From: cocoa-dev-bounces+danyg=email@hidden [mailto:cocoa-dev-bounces+danyg=email@hidden] On Behalf Of Seth Willits
Sent: Monday, January 02, 2012 20:28
To: cocoa-dev cocoa-dev
Subject: Re: Modal Window for NSTextField
On Jan 2, 2012, at 4:02 AM, Dany Golubitsky wrote:
> // Make the text field "in focus", and start an editing session on it
> [textField becomeFirstResponder];
-becomeFirstResponder is a notification method for when the responder becomes first responder; it doesn't *make* it first responder. For that you want [window makeFirstResponder:].
> Now I tried 2 approaches:
Both are wacky as Michael explained.
You do not need the window to be modal at all. The solution is really simple. Just start editing the text field, and when the editing is done (controlTextDidEndEditing: notification), you just remove the text field.
--
Seth Willits
_______________________________________________
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
_______________________________________________
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