Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Carbon/Cocoa clipboard problem




On Apr 20, 2007, at 5:42 PM, Brian Arnold wrote:

Hi,

Puzzler for the day:

I have a Java-based UI, and a C/C++ Carbon-based UI, each in separate
windows, where neither seems to "know" about each other's clipboard unless I
switch out of the application (both UI's) and back in again. If I don't
switch out, then Java only copies and pastes between Java windows, and the
Carbon-based UI only copies and pastes between Carbon-based windows.


I'd like copy and paste to just work, which means when I copy in a Java
window, I can paste it in a Carbon-based window without switching out and in
again.


Has anyone experienced something like this (SWT-AWT for example), and do you
know what the trick is? I have a Carbon Event handler that can listen.
Listening to kEventWindowActivated and kEventWindowDeactivated seems like a
good idea, but I haven't figured out what to call.

I modified this SWT snippet:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/ org/eclipse/swt/snippets/Snippet94.java?view=co

to create an AWT Frame and TextArea. Copying from one to the other worked fine, so I'd take a look at SWT's Clipboard implementation. The SWT just grabs the data of type kScrapFlavorTypeText and then returns it as a CFStringRef.

Or are you not working with text in this case?

Scott

------------------
Scott Kovatch
Apple Inc.
Java Runtime Classes
Cleveland Hts, OH
email@hidden

I am Scott Kovatch, and I approved this message.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Carbon/Cocoa clipboard problem (From: Brian Arnold <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.