• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting hold of a Documents Window for displaying a Sheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting hold of a Documents Window for displaying a Sheet


  • Subject: Re: Getting hold of a Documents Window for displaying a Sheet
  • From: Scott Anguish <email@hidden>
  • Date: Mon, 26 Apr 2004 19:45:38 -0400

It's hard to tell from this what is what. you're making a new InfoController (which is a window controller for the sheet maybe? this is what is hard to tell).

But if you make a new one and never set a window for it, you'll never get a window value back from it.


You should just be able to get the windowControllers for the document and (assuming you only have one) use the first one to get the window and use that to attach the sheet to.


On Apr 26, 2004, at 7:04 PM, Kevin Bracey wrote:

Hi all,
I've been battling this for a few days now and that means I'm doing something wrong. There is very little in the way of comments concerning this which also means I'm doing something the wrong way.

I'm trying to achieve this:
I have a document based App, each doc has additional properties, such as header information which is not displayed in the main doc window.
I would like when selecting a menu Information for a sheet to pop down and allow editing of this extra information, (just a MutDic)

I have achieved:
Setting up the menu and creating the delegate,
Getting the showInfo in the MyDocument, message to fire,
but for the life of me my document doesn't have a _window, I can see it on the screen with my own two eyes, but when debugged there is no _window, I can move it to with [[self windowForSheet] center], but when used in the NSApp sheet command it's not there? So I get this nice sheet popping out of nowhere.

this is in MyDocument

myInfo = [[[InfoController alloc] init] autorelease];
if( myInfo )
{
NSLog(@"I am in showPanel :%@", [myInfo description]);
NSLog(@"I am in self windowForSheet :%@", [self windowForSheet]);
[NSApp beginSheet:[myInfo window]
modalForWindow:[self windowForSheet]
modalDelegate:self
didEndSelector:NULL
contextInfo:nil];
[NSApp runModalForWindow:[self windowForSheet]];
// Sheet is up here.
NSLog(@"does it come back here???");
[NSApp endSheet: [self windowForSheet]];
[[myInfo window] orderOut:nil];
}

2004-04-27 10:56:16.905 Lists[2801] I am in showPanel :<InfoController: 0x39adc0>
2004-04-27 10:56:16.905 Lists[2801] I am in self windowForSheet :<NSWindow: 0x34c960>
2004-04-27 10:56:23.181 Lists[2801] does it come back here???

I also have a close message connected to a button.

This has me totally puzzelled. Any hints as to where I'm going wrong?

Kind Regards
Kevin Bracey










The best defense against logic is ignorance. _______________________________________________
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.


References: 
 >Getting hold of a Documents Window for displaying a Sheet (From: Kevin Bracey <email@hidden>)

  • Prev by Date: Re: Standard User Defaults - Setting initial values
  • Next by Date: Re: KeyValue Observing rant
  • Previous by thread: Getting hold of a Documents Window for displaying a Sheet
  • Next by thread: Getting hold of a Documents Window for displaying a Sheet
  • Index(es):
    • Date
    • Thread