Re: Hiding a view
Re: Hiding a view
- Subject: Re: Hiding a view
- From: Rainer Brockerhoff <email@hidden>
- Date: Thu, 25 Oct 2001 13:07:55 -0200
From: Ondra Cada <email@hidden>
Date: Thu, 25 Oct 2001 11:45:41 +0100
Dustin Mierau (DM) wrote at Thu, 25 Oct 2001 00:17:15 -0700:
DM> This is probably a stupid question, how do I hide a subview? I
DM> can't actually find a method to "hide" an NSVIew.
Move it well outside its superview (eg. set its origina to
[100000,origy] or so).
Moving up and/or to the left seems to be better... moving down or to
the right as in your example apparently may move the view when the
window is resized... be prepared to recalculate the view's origin to
move it back, and not depend on where it was or on where you left it.
I couldn't find this caveat in TFM, BTW :-)
A somewhat inelegant alternative is to group one or several views
into a superview, and set the size of the superview to 0 by 0. The
subviews will be clipped while drawing.
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Oct. 2001)