views:

172

answers:

1

I have several CATextLayers. When I doubleclick one of them, I want to be able to edit it's string. Think of text as it's handled in Keynote or many other apps. Any ideas?

I thought of putting an editable textfield right in front of the layer and then dismiss it on enter, but I didn't get far. :-(

I target Mac OS X 10.5 with Objective-C 2.0 and Garbage Collection.

Any help or pointers would be greatly appreciated. Thanks in advance!!

+2  A: 

I think your approach using an editable NSTextFieldCell is the right way to go. It's not a trivial task, but you can do it.

Barry Wark
Has this been done before? I mean is there sample code perhaps? I didn't find any on Apple's site and on some of the Cocoa sites I visit.I can't be the first with this problem, right?
Ron
I don't know of any sample code, but `NSCells` are pretty lightweight. Check out the Control and Cell Programming Guide (http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/ControlCell/ControlCell.html).
Barry Wark