• 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
Swapping an NSView between NSWindows
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Swapping an NSView between NSWindows


  • Subject: Swapping an NSView between NSWindows
  • From: Michael Wood <email@hidden>
  • Date: Fri, 6 May 2005 15:35:58 -0700

Hi, I have a document-based application with a main NSWindow (mainWindow). The mainWindow has an NSView (mainView) which was added using Interface Builder. While the application is running, I programatically create a new window and set its content view using setContentView:

[newWindow setContentView:mainView];

This has the desired effect of moving my view to the newWindow, without any delay. Transfering the view from one window to another in this way seems to wipe out the view in the original window.

I would like to transfer the view back to the original window from the newWindow (the same way it was set up in Interface Builder). My problem is that I can't use "[mainWindow setContentView:mainView]" because it removes the entire content view from the original window which contain buttons that need to remain.

Is there any way to swap an NSView between NSWindows by either:

a) programatically sizing and positioning an NSView inside an NSWindow?
b) reconstructing the NIB and replacing the NSView with my mainView?
c) referencing my mainView in my newWindow so [newWindow setContentView:mainView]; doesn't kill the mainView from my mainWindow?


Thanks,

Mike.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Function to write to one pixel?
  • Next by Date: NSConnection Name-space and Fast User Switching
  • Previous by thread: TableView and Bindings
  • Next by thread: Re: Swapping an NSView between NSWindows
  • Index(es):
    • Date
    • Thread