• 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: changing entire content view of an NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing entire content view of an NSWindow


  • Subject: Re: changing entire content view of an NSWindow
  • From: Andreas Wolf <email@hidden>
  • Date: Tue, 15 May 2001 14:55:41 -0700

> If that doesn't work, try putting an NSBox without borders or titles on your main
> window, make it as large as the window's contentView, and then set its
> contentView to whatever view you want the user to see. That should work (I know
> because I've done it before)

Thanks much for your help!
I tried out what you suggested but I couldn't get it to work, either.
(I also had sent the display message before)

Here is what I do:
In the bundled app I have a method

-(NSView*) getView:(id) sender
{
return [myWindow contentView]; // myWindow outlet connected to the bundles window
}

Now, in my real app I want to set the bundle's view to the app's window content view (or NSBox contentView, or whatever)

Class componentClass;
id component;
NSView *otherView;

NSBundle *bundle = [NSBundle bundleWithPath:@"otherapp.bundle"];

if(componentClass =[bundle principalClass])
{
component = [[componentClass alloc] init];

[component loadNib:self]; // tell otherapp to load its nib
otherView = [component getView:nil]; // get otherapp's view

[myNSBox setContentView: otherView];

[myNSBox display];
}

The bundle loads correctly and it starts up, because I instantiate it, but it does not display it's view in my apps view,
regardless of wether I set it to the windows content view or to an NSBox's content view.

What am I doing wrong?

Thank you very much,
-Andreas


  • Follow-Ups:
    • Re: changing entire content view of an NSWindow
      • From: Enrique Zamudio <email@hidden>
  • Prev by Date: Re: Is there a way to Creating a Control Panel App using Cocoa
  • Next by Date: Still having problume with Security API
  • Previous by thread: Re: changing entire content view of an NSWindow
  • Next by thread: Re: changing entire content view of an NSWindow
  • Index(es):
    • Date
    • Thread