Skip navigation.
 
mlRe: Using an NSView as a sheet
FROM : Eric Forget
DATE : Fri Nov 26 20:22:07 2004

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_removed>            <http://www.cafederic.com/>

Related mailsAuthorDate
mlUsing an NSView as a sheet John Spicer Nov 26, 15:36
mlUsing an NSView as a sheet John Spicer Nov 26, 20:00
mlRe: Using an NSView as a sheet Eric Forget Nov 26, 20:22
mlRe: Using an NSView as a sheet Gregory Weston Nov 26, 22:50