Clipboard? Copy/Paste?

Hi,
I'm writing a program on a Mac in C++, and I want to be able to take the text data in my program and copy it so that it can be pasted into another program using command-c and command-v or an edit menu to copy and paste. Does anyone know how to do this?
Thanks,
Sean =)

iMac 24 inch, Mac OS X (10.5.5)

Posted on May 6, 2009 9:10 AM

Reply
2 replies

May 6, 2009 1:24 PM in response to Sean McGuffee

Why not hook your code up to a Cocoa UI? Most of the AppKit controls that support editing will support cut and paste, and the Xcode Cocoa template includes an operating standard menu with all the right shortcuts. If you're using Xcode (or gcc by itself if you know the right flags), I think C++ can be mixed with Obj-C almost as easily as straight C. At the very worst you'll need separate files bridged with C functions.

Uh oh... Wait! don't click Post Message, I already see the problem. You need to use that expensive compiler of yours that won't support any of the above, right? And we've already been over why its libraries won't link to a gcc front end? Oh well.. Yet another happy thought shot down in flames.

I'm sorry I don't know anything about building a Carbon UI. I'm sure someone else here can help you with that, though.

All the best,
\- Ray

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Clipboard? Copy/Paste?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.