Re: Collapse / Expand View
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