Re: Modal Window for NSTextField
Re: Modal Window for NSTextField
- Subject: Re: Modal Window for NSTextField
- From: Michael Babin <email@hidden>
- Date: Mon, 02 Jan 2012 09:52:10 -0600
On Jan 2, 2012, at 9:22 AM, Dany Golubitsky wrote:
> Thank you!
>
> As for field editor - can it appear and disappear during runtime? Indeed, I do not familiar with this approach.
"The field editor is a single NSTextView object that is shared among all the controls in a single window, including buttons, table views, and text fields. This text view object provides text entry and editing services for the currently active control. When the user clicks in a text field, for example, the field editor begins handling keystroke events and text display for that field."
So, yes.
> About beginSheetModalForWindow - indeed, I tried to do the following either:
> [textField beginSheet:[textField window] ModalForWindow:[superView window] modalDelegate:superView didEndSelector:0 contextInfo:0];
Again assuming that you mean - [NSApplication beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:], you would not send that message to textField (which is not an NSApplication object, unless your approach/naming has changed much more radically than described).
Given that textField is a subview of superView, you're attempting to use a window as a sheet for itself. I doubt that approach would yield useful results.
> and yes, I implemented endSheet. I tried to call endSheet from mouseDown event. I saw this function being called, however still, the white window was not closed and I was stuck in beginSheet (The code after it was unreachable).
>
> Can you suggest why?
- [NSApplication endSheet:] and -[NSApplication endSheet: returnCode:] do work to end a modal session using a sheet, in my experience, provided you supply the appropriate arguments. Your problem could also be due to trying to use a window as a sheet for itself, as mentioned previously.
_______________________________________________
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