RE: Communication between a NSTabView and an NSTextField...
RE: Communication between a NSTabView and an NSTextField...
- Subject: RE: Communication between a NSTabView and an NSTextField...
- From: "Huyler, Christopher M" <email@hidden>
- Date: Thu, 11 Dec 2003 17:40:53 -0500
- Thread-topic: Communication between a NSTabView and an NSTextField...
Ok, my problem has escalated...I also need the same type of behavior
from the Preference Panel. However, the sequence of events is reversed.
textShouldEndEditing gets called before
(NSPreferencePanelUnselectReply)shouldUnselect. This time when I click
"Show All" the alert sheet pops up, and then while it is displayed,
System Preferences proceeds to display all the other Pref Panels
underneath.
I tried the following:
- (NSPreferencePaneUnselectReply)shouldUnselect
{
if ( [NSApp mainWindow] != [NSApp keyWindow] )
return NSUnselectCancel;
else
return NSUnselectNow;
}
However, it only works once because after shouldUnselect returns, the
NSTextField (or should I say the Window's field editor) is not the first
responder. If I click "Show All" again it lets me do it even though the
value in NSTextField is invalid.
-----Original Message-----
From: Matt Gillette [
mailto:email@hidden]
Sent: Thursday, December 11, 2003 4:54 PM
To: Huyler, Christopher M
Cc: email@hidden
Subject: Re: Communication between a NSTabView and an NSTextField...
Just call textShouldEndEditing inside your shouldSelectTabViewItem
method and return the value returned from textShouldEndEditing.
Matt
On Dec 11, 2003, at 12:54 PM, Huyler, Christopher M wrote:
>
I have a NSTextField inside a NSTabViewItem with a delegate that
>
responds to textShouldEndEditing. If That succeeds the NSTextField
>
performs an action (which saves the information the user entered). If
>
the user enters invalid information then textShouldEndEditing presents
>
a
>
sheet telling the user to fix it and returns NO.
>
>
However, if the user clicks on a different tab after entering invalid
>
information, the sheet pops up but the tab still changes. How can I
>
use
>
tabview:shouldSelectTabViewItem delegate to catch this event and
>
prevent
>
the tab from changing if the user has entered invalid data? It
appears
>
that tabview:shouldSelectTabViewItem is called before
>
textShouldEndEditing. Is there a way to reverse this?
>
>
Essentially, I want to block all other events until
>
textShouldEndEditing
>
returns YES.
>
>
--
>
Christopher Huyler
>
Computer Associates Intl.
>
mailto:email@hidden
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.