• 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: Using an NSView as a sheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using an NSView as a sheet


  • Subject: Re: Using an NSView as a sheet
  • From: Eric Forget <email@hidden>
  • Date: Fri, 26 Nov 2004 14:22:07 -0500

Hi,

A sheet is in fact a NSPanel which derives from NSWindow. So you can add
your view with something like:

NSView  *contentView = [myWindow contentView];

[myView setFrameSize:[contentView frame].size];
[contentView addSubview:contentView];

There is just one gotcha you have take into account. A view cannot be
inserted in two view hierarchies at the same time. If it is what you need,
make sure you load the nib file two times.

Éric


> Is it possible to do this? I have a window (prefs) in one place that
> uses it as the content (using setContentView or something like it), and
> in another place I need it to come down from the login window as a
> sheet.
>
> Is there a way to do this? Otherwise it looks like two nibs and I guess
> two copies of the code (which I don't like).
>
> Advice, anyone?

___________________________________________________________________

 Eric Forget                       Cafederic
 email@hidden             <http://www.cafederic.com/>



 _______________________________________________
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

References: 
 >Using an NSView as a sheet (From: John Spicer <email@hidden>)

  • Prev by Date: What is NSConcreteMutableData?
  • Next by Date: Re: Changes won't take in Bound TableView
  • Previous by thread: Using an NSView as a sheet
  • Next by thread: Using an NSView as a sheet
  • Index(es):
    • Date
    • Thread