Re: Question on pasteboard manager
Re: Question on pasteboard manager
- Subject: Re: Question on pasteboard manager
- From: "I. Savant" <email@hidden>
- Date: Fri, 20 Feb 2009 12:42:31 -0500
On Fri, Feb 20, 2009 at 12:25 PM, Anin Teger <email@hidden> wrote:
> 1. To programatically enable the Paste menu item in any application's
> Edit menu. I'm not looking to do this for any specific application but
> in general so that if you were to open any application that has an Edit
> menu, the Paste menu item would be enabled. I couldn't figure out how
> to do this with the Pasteboard manager API.
That doesn't make much sense. If a Paste menu item is disabled, it's
because the application knows (because it's uniquely qualified to) if
it has a valid target into which to paste, and if the object on the
pasteboard is a type it knows how to handle. Force-feeding a paste
operation will very likely screw things up for your user. BAD IDEA.
> 2. When a user clicks the "Paste" menu item, I'd like to register a call
> back function so that my function would be called first. I could then
> insert data into the pasteboard and have the application paste those
> contents.
Same problem. Merely forcibly-enabling the paste menu to allow a
paste, and putting something else on the pasteboard (even if your
application is doing something first, then calling the target app's
paste function) is foolhardy. You cannot know for all apps what this
means - again, this is a BAD IDEA.
Code injection. Personally, I never use any apps that make use of
this (because there's almost always some unintended side-effect that
ruins my day), but there you go. Google searches for "cocoa code
injection" will get you started on that very broad topic.
> Any ideas? I am interested in porting a Windows based application that
> relies on this functionality.
Ouch. What *exactly* is your intention? The end result you're
looking for? Maybe there's a better all-around solution on this
platform that you haven't thought of because it's not possible on the
Windows platform.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden