Sorry, the last email got posted as rich text and became garbled. Allow me to 
try again.


Thanks for your reply


My plan is to have a one big view covering the whole window, and then put a one 
big layer covering all that view. That way the rest of the user interface could 
just be many sublayers within the big layers.


The rounded rectangle I mentioned would be one of those sublayers. However, I 
would want the text field would be a part of that particular sublayer.


So, are you saying that when the user double-clicks the rounded rectangle layer 
and animates to expand, I should (with code) on the spot make a text field in 
there to display my wanted (editable) text? By doing that, don't I run into the 
risk of the text not appearing until the animation is over? I would rather want 
the text field to gradually show as the animation is occurring.


Can I somehow back a text field with a layer to control how the text field 
looks? Will that still make the text field editable? If I can somehow do this, 
I guess I could use masksToBounds=YES on the rounded rectangle so that the text 
field will be there "inside" but can remain hidden. That way I might be able to 
put (with code) the layer backed text field there before the animation takes 
place, even though the text field will not be fully visible until the animation 
is over.


What do you think?


> CC: cocoa-dev@lists.apple.com
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Re: Simple Core Animation Problem
> Date: Sat, 29 Nov 2008 00:08:44 -0700
> 
> - Layers can have rounded rects by setting the layer's cornerRadius  
> property. BTW, you can't create layers in a NIB. The *must* be created  
> in code.
> - Layers do not inherit from NSResponder so clicks (and double-clicks)  
> must be registered through a backing layer
> - You can easily hide a view such as an NSTextField. When your height  
> animation completes, you will get an -animationDidStop notification at  
> which point you can show your NSTextField (look at setHidden in NSView).
> 
> You said simple. I'm not so sure that's true. I suggest you write some  
> code and post specific questions.
> 
> Best Regards,
> 
> -Matt
> 
> 
> 
> 
> On Nov 28, 2008, at 7:26 PM, Ulai Beekam wrote:
> 
>>
>> I want to create this user interface element:
>> A rounded rectangle somewhere on the window (it should be able to be  
>> created through code, not inside the NIB).
>> If I double click it, it should increase its height using animation.
>> But here is the catch: When the heigh is increased, a text field is  
>> revealed! In other words, there is a text field that is a part of  
>> that box, and is only revealed when the box height is increased.
>> How can I "attach" a textfield to a layer like that?
>> Thank you.
>>
>> U.

_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to