I have a QTMovieView and a CATextLayer (as the QTMovieViews sublayer) to display text (duh). Now, I would like to edit this text when a user clicks an edit button. What would be the best way to get this done?
I've thought of that, but CALayers offer me some features I couldn't really get to work with layer backed NSViews. One thing is the positioning. My movie is displayed in a split view. When I collapse this split view and then reopen it, positions are totally messed up when I use NSViews (usually, my view just disappears), but with CALayers and CAConstraintLayoutManager things work perfectly with just 2 lines of code per layer (plus 1 line to set up the layout manager). Maybe there's a way to use CAConstraints with NSViews too, but I couldn't get it to work for me (and didn't find anything on google either except statements that it doesn't exist ). The other thing is, CATextLayer automatically resizes itself to display the string given to it. I know that can also be done with NSTextView & co., but again, I'd need additional code. Which sucks. Gives me more to debug (and I hate debugging).
I guess I could try to use an layer backed NSTextView that will be displayed if the text should be edited, and the CATextLayer for the rest of the time.
One option could be to create an NSTextView inside a borderless/clear/shadowless window and position it directly above the text layer while hiding the text layer and allow the user to edit there, expanding the text view/window as they type.
One option could be to create an NSTextView inside a borderless/clear/shadowless window and position it directly above the text layer while hiding the text layer and allow the user to edit there, expanding the text view/window as they type.
Yeah, that was my "escape-route". I just thought there might be a more straight-forward way of doing this. It's my first attempt at using Core Animation (which really is much more than just animation).
Thanks for the replies. (and if anyone has a better solution, please tell me!!!)