Skip navigation.
 
mlRe: View disappears with NSViewAnimation
FROM : Paul Kim
DATE : Tue Jul 11 23:44:26 2006

I believe that when NSViewAnimation finishes and a view's frame is 0 
width or height its hidden flag gets set.

From the docs (specifically in the description for the 
NSViewAnimationEndFrameKey):

"If the target is a view and the end frame is empty, the view is 
hidden at the end."

You may want to try using setHidden:NO on the Notes view before the 
start of the animation. Personally, I feel NSViewAnimation should do 
this for you but you have to play with the cards you're dealt.

paul



On Jul 11, 2006, at 5:12 PM, August Trometer wrote:

> Yeah, I thought of that, but I don't think this is the problem.
>
> The view itself (right now) is a custom view that draws its own 
> background. It has 2 "springs" set in IB -- one to resize 
> vertically and another to have a flexible outer right side (the 
> side with the "content" view). Everything else is static. And I've 
> tried removing the settings with no beneficial effect.
>
> -- August
>
>
>
>
>
>
> On Jul 11, 2006, at 12:40 PM, Ryan Britton wrote:
>

>> I'm assuming the notes section uses some auto-sizing flags?  When 
>> the frame gets set to 0 width, the subviews are auto-sized to 0 
>> width as well.  When you attempt to size them up, they remain at 0 
>> width because x * 0 = 0.
>>
>> On Jul 11, 2006, at 8:12 AM, August Trometer wrote:
>>

>>> Hello!
>>>
>>> I have two views, side by side. One is the main "content" of the 
>>> window, the other is a "notes" bar.
>>>
>>> I am using NSViewAnimation to open and close the Notes section. 
>>> To close the Notes, I set the Notes view frame to 0. When I open 
>>> it, I set it to 150.
>>>
>>> If I use setFrame: to open and close the Notes everything works 
>>> fine. When I use NSViewAnimation, however, things get screwy. I 
>>> can close the Notes just fine, but when I open them, the view 
>>> doesn't appear. I've NSLogged the before/after frame width and 
>>> NSViewAnimation seems to be doing its job, but the view simply 
>>> doesn't show.
>>>
>>> After messing around with it for a while, I noticed that if I set 
>>> the "closed" width to 1 instead of 0, everything works fine!
>>>
>>> Is this a bug or a known issue? Is there a workaround? Right now 
>>> I'm setting the closed width to .00001 -- it works, but it seems 
>>> like a hack. Any ideas?
>>>
>>>
>>> Thanks!
>>>
>>> August
>>>
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Cocoa-dev mailing list      (<email_removed>)
>>> Help/Unsubscribe/Update your Subscription:
>>> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>>>
>>> This email sent to <email_removed>

>>
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Cocoa-dev mailing list      (<email_removed>)
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>>
>> This email sent to <email_removed>

>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlView disappears with NSViewAnimation August Trometer Jul 11, 17:12
mlRe: View disappears with NSViewAnimation Ryan Britton Jul 11, 18:40
mlRe: View disappears with NSViewAnimation August Trometer Jul 11, 23:12
mlRe: View disappears with NSViewAnimation Paul Kim Jul 11, 23:44
mlRe: View disappears with NSViewAnimation August Trometer Jul 12, 00:00