Re: self Changes on Open Panel
Re: self Changes on Open Panel
- Subject: Re: self Changes on Open Panel
- From: "K. Darcy Otto" <email@hidden>
- Date: Tue, 9 Jun 2009 15:55:45 -0700
You're right, my two questions are related. I do, ultimately, want to
tell if a panel is open. The reason I want to know whether the panel
is open, is that I want to disable certain menu options via -
validateUserInterfaceItem while that panel is open. The panel is a
sheet that comes down in front of the document window when the
document window is first opened (a la Pages or Keynote when they show
you templates), and as long as it is down, I don't want users to be
able to access the "delete line" menu option.
But, the more I got into trying to solve the problem, the more I
became perplexed about self referring to two different objects. I"m
wondering what is actually going on (independently of whether I get
the sheet working). It seems like the sort of thing that might cause
other problems.
D
On 9-Jun-09, at 10:12 AM, Greg Guerin wrote:
K. Darcy Otto wrote:
-(void)windowWillBeginSheet:(NSNotification *)notification
{
sheetOpen = YES;
NSLog(@"self at -windowWillBeginSheet: %@",self);
}
I would NSLog the before and after state of sheetOpen, i.e. on entry
to the method body and on exit from the method body. I might even
consider assertions.
Please show the code that defines the sheetOpen class variable, and
identify exactly where it resides (which class), and how other
classes have access to it. I mention this because all the behavior
you've described so far is consistent with what happens if sheetOpen
isn't actually a class variable or a static variable, but is an
instance variable.
Finally, please explain what problem you're trying to solve by
having a boolean sheetOpen class variable. Is this related to your
earlier "How to tell if a Panel is Open" question? If so, please
explain the premise of that question: you wrote, "I need to know
whether a particular panel is open", but never explained why you
need to know that, or what you'd do with that state.
-- GG
_______________________________________________
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