Re: animating the info text upwards
Re: animating the info text upwards
- Subject: Re: animating the info text upwards
- From: Greg Titus <email@hidden>
- Date: Wed, 19 Mar 2003 21:55:43 -0800
On Wednesday, March 19, 2003, at 08:41 PM, Francisco Tolmasky wrote:
I'm trying to recreate the effect from the finder windows when you
press "customize toolbar" That little informational section moves
upwards and then the customize toolbar stuff shows up in the window
itself. I was wondering how to make the little information thing move
upwards. I currently have two views, one which is shown by default,
another which I wish to show when a certain button is pressed. I was
considering just timing it and moving the view upwards in a for
loop-type of situation, but I was wondering if there was some sort of
animate: message that could do this for me.
The key thing to notice when the Finder does this, is that the window
is shortening itself by the same amount as the height of the status bar
view. This insight might lead you to look at the
-setFrame:display:animate: method on NSWindow....
You can recreate this effect by setting the autoresizing mask of both
your views to NSMinYMargin. (Via -setAutoresizingMask:). This keeps the
sizes of your views and their distance from the bottom window border
constant even when the window resizes.
Then just resize the window by calling -setFrame:display:animate:, with
the frame being the old frame but with the y position increased by the
status bar height and the height decreased by the status bar height.
Pass YES for the display and animate parameters.
The window will animate resizing, and as it grows shorter, both views
will move up, and the status bar view will slide out of sight. Change
both views' autoresizing masks back to their original values, and you
are done.
Hope this helps,
- Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.