• 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: Collapse / Expand View
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Collapse / Expand View


  • Subject: Re: Collapse / Expand View
  • From: Gregory Weston <email@hidden>
  • Date: Fri, 19 Nov 2004 23:48:09 -0500

Byron Wright wrote:

Is there a view that I can use that is collapse and expandable like the
native "get info" pane from files? I attempted this with a NSTimer and
a NSClipView but it seems I would have to manage size change
notifications because I am having some redraw issues when altering the
height of a NSClipView using setFrameSize. (I call setNeedsDisplay:YES)
after. I would like my window to resize accordingly.

While a couple of people responded with pre-rolled solutions, handling disclosure controls may be an informative exercise and is simple enough to not be a huge time sink. Basically what you end up doing is walking the list of siblings to the view you want to expand, binding all those that are below it to the bottom of the window and those above it to the top. The view you want to expand is allowed to grow. Then you determine the new size/location of the window and tell it to resize itself with the animation option turned on.


Methods to investigate:
on NSView:
 setAutoresizingMask:
on NSWindow
 setFrame:display:animate:

Note that because the coordinate system is rooted at the lower-left that you'll want to move the origin of the window as well as changing its size.

I have a test program consisting of a single written method if you'd like sample code.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: My bug or Apple's?
  • Next by Date: Application Services
  • Previous by thread: Re: Collapse / Expand View
  • Next by thread: XCode source folder disabled problem
  • Index(es):
    • Date
    • Thread