• 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
Re: Making views disappear and reappear
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making views disappear and reappear


  • Subject: Re: Making views disappear and reappear
  • From: Peter Ammon <email@hidden>
  • Date: Mon, 25 Jun 2001 09:56:43 -0700

on 6/23/01 12:58 PM, Mark T at email@hidden wrote:

> I'm still relatively new to cocoa programming so please excuse me if
> this question has an simple or obvious answer.
>
> I'm trying to make a TableView disappear and reappear in response to
> a user clicking a button. I was going to use removeFromSuperview, but
> it says to not invoke it during display. So I tried using
>
> [[self myTable] retain];
> [[self myTable] removeFromSuperviewWithoutNeedingDisplay];
>
> This caused no visual change(the table still looked like it was
> there), but you could no longer click on the table or interact with
> it in any way. Trying to reverse this situation with addSubview had
> no effect.
>
> Any tips or code snippets would be much appreciated.
>

One technique I use to show or hide views is to put them in an NSBox and set
the frame of the box to something very small when they need to be hidden.
It works particularly well when I need to show or hide multiple views; e.g.
I have a row of NSColorWells, and clicking a NSStepper seems to make more
wells appear or disappear, where all that's really happening is that the
containing box's frame is getting bigger.

-Peter


References: 
 >Making views disappear and reappear (From: Mark T <email@hidden>)

  • Prev by Date: Re: Shared object between two nib file.
  • Next by Date: Re: Calling Cocoa from C
  • Previous by thread: Re: Making views disappear and reappear
  • Next by thread: Scaling images
  • Index(es):
    • Date
    • Thread