• 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: Swapping contents of windows from nibs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Swapping contents of windows from nibs


  • Subject: Re: Swapping contents of windows from nibs
  • From: Erik Buck <email@hidden>
  • Date: Thu, 8 Nov 2007 07:16:19 -0800 (PST)

  One approach is to use a tab-less tab view to hold all of your different "contents" in one window and just programatically switch tabs.
  However, assuming there is some reason you want to define "contents" in different windows (perhaps to keep different "contents" in different nibs), I must ask the following questions:

  Where have you looked in the documentation ?
  Do you have some objection to using the following: ?
  -(id) contentView  and
  -(void) setContentView:(NSView*) aView
  http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWindow/setContentView:

  Try this (written in Mail):
  - (void)setContentOfWindow:(NSWindow *)destinationWindow usingSourceWindow:((NSWindow *)sourceWindow
  {
      id          contentView = [[sourceWindow contentView] retain];  // get the content view

      // remove the view from its window because a single view can’t be in two windows at once
      [contentView setContentView:[[[NSView alloc] initWithFrame:NSZeroRect] autorelease]];

      // replace the content of destinationWindow
      [destinationWindow setContentView:contentView];
      [contentView release];
  }



_______________________________________________

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

  • Follow-Ups:
    • Re: Swapping contents of windows from nibs
      • From: Hasani Hunter <email@hidden>
  • Prev by Date: NSOpenGLView overlap
  • Next by Date: predicate with smallest x-coordinate?
  • Previous by thread: Re: Swapping contents of windows from nibs
  • Next by thread: Re: Swapping contents of windows from nibs
  • Index(es):
    • Date
    • Thread