• 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
Yet another way of Hiding a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Yet another way of Hiding a view


  • Subject: Yet another way of Hiding a view
  • From: "Erik M. Buck" <email@hidden>
  • Date: Thu, 25 Oct 2001 10:11:33 -0500

replaceSubview:with:
- (void)replaceSubview:(NSView *)oldView with:(NSView *)newView

Replaces oldView with newView in the receiver's subviews. Does nothing and
returns nil if oldView is not a subview of the receiver.
This method causes oldView to be released; if you plan to reuse it, be sure
to retain it before sending this message and to release it as appropriate
when adding it as a subview of another NSView.

See Also: - addSubview: - addSubview:positioned:relativeTo:



When you want to hide a view, replace it with an empty view (a NSBox or just
an NSView) that is the same size and has the same resizing options.

When you want to restore a view, replace the empty view with your view
making sure the size is the same as the view being replaced.

This will make sure that resizing works even when the view is hidden.


References: 
 >Re: Hiding a view (From: Eric Peyton <email@hidden>)
 >Re: Hiding a view (From: Rosyna <email@hidden>)

  • Prev by Date: Re: Hiding a view
  • Next by Date: keyDown how to pass on events?
  • Previous by thread: Re: Hiding a view
  • Next by thread: Re: Hiding a view
  • Index(es):
    • Date
    • Thread