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/>
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 mails | Author | Date |
|---|---|---|
| John Spicer | Nov 26, 15:36 | |
| John Spicer | Nov 26, 20:00 | |
| Eric Forget | Nov 26, 20:22 | |
| Gregory Weston | Nov 26, 22:50 |






Cocoa mail archive

