Re: Making views disappear and reappear
Re: Making views disappear and reappear
- Subject: Re: Making views disappear and reappear
- From: "David P. Henderson" <email@hidden>
- Date: Sun, 24 Jun 2001 00:34:09 -0400
On Saturday, June 23, 2001, at 09:19 , Mark T wrote:
>
This is what I'm doing, and it still fails to reappear after
>
addSubview. Here's the code for the Hide/Show button's action, maybe
>
someone can figure out what I'm doing wrong:
>
>
NSView * theSuperview = [theScrollview superview];
Here's your problem. After you remove your scroller from the view it no
longer has a superview. So this returns nil. You need to get the
window's content view. Try this in place of the above:
NSView *theSuperview = [[sender window] contentView];
One trick that works well is to place any controls/views, which you wish
to remove, inside borderless/titleless boxes and swap in and out the
content view of the box.
Dave
--
Chaos Assembly Werks
"A lie can run around the world before the truth can get its boots on."
- Israel Zangwill (not Edward R. Murrow)