• 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: Tue, 27 Apr 2004 01:41:57 -0400

On Apr 26, 2004, at 9:22 PM, Kevin Bracey wrote:

Thanks Scott,

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

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).
Yes, it is a InfoController : NSWindowController and has a separate NIB.

In your Information.nib, you'll need to make the InfoController class the File's Owner, and then connect the window that you want to use for that WindowController to the window outlet of the File's Owner..

Do you have things like that now?

I think I'd do this like this from my Document subclass

- dosomethingthatbringsupthesheet
{
// init my infocontroller
// explicitly set the window it should be created on (since a document could have multiple windows)
// explicitly set the document that it is attached to
// call some method in my infocontroller class that puts the sheet on that specified window 2with the document data
}

add these to the info controller

NSWindow *documentWindow;
NSDocument *document;


then have infocontroller's init method just call the super method with the correct nib name and do any other set up (holdProperties should be used through an accessor! :-)
-(id) init
{
if( self = [super initWithWindowNibName:@"Information"])
{
holdProperties = [[NSMutableDictionary dictionary] retain];
return self;
}

This doesn't rely on the main window, and has a much more straight forward trail for finding the problem
_______________________________________________
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: NSOpenPanel and JPG files
  • Next by Date: mental crutch for class vs instance methods
  • Previous by thread: Getting hold of a Documents Window for displaying a Sheet
  • Next by thread: Filling NSBezierPaths completely
  • Index(es):
    • Date
    • Thread