[futurebasic] Re: [FB] Append a String to the Clipboard in Carbon

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2002 : Group Archive : Group : All Groups

From: gnome <gnome@...>
Date: Sat, 15 Jun 2002 14:06:30 +0200
Le samedi 15 juin 2002, à 01:36 , RICH LOVE a écrit :

> I am trying to append a string to the clipboard (add to the clipboard
> instead of clearing it first. I am running carbon standard basic.

the clipboard in carbon has changed radically.
as far as i can see, it no longer exists -- per se.

it now acts like the drag manager with 'promises' of content,
the application that filled the clipboard being called to
forfil that 'promise' if a paste takes place...

as i understand:
scenario 1 - something on the clip when your app starts
scenario 2 - you copy something to the clip
scenario 3 - you want to export through the clip
scenario 4 - the persistence of the clip after your app quits
[if you can think of other scenarii then please propose them].

1 - when you app starts it should poll the clip to see what
flavors it proposes. if there is one there that interests you,
then that is the one that your app will be dealing with.

2 - it is best not to! you should store your content in a
temp area [handle] inside your app, and only make it available
to the clip if your app is sent to the background.
if your app is backgrounded you should decide what 'flavors'
you will promise depending on the content.

3 - as above, you will decide on flavors depending on content.

4 - i have asked about this...

ok, what is this 'flavors' stuff?

let's suppose that your app just plays with unstyled text. in this
case your only flavor will be 'text'. but as you know, most unstyled
text is in fact 'mono-styled' text. and styled text can have three
flavors 'styl' [text with the 'styl' info], 'rtf ' [the preferred
styled text format for mac os x], and basic 'text'.
in this case you would 'promise' the scrap manager those three flavors.
the app that wants to use the clip contents will decide what it wants,
and send a message to your app asking you to deliver on your promise.
this is when you send the content to the scrap manager.

now suppose a postscript graphics app. this can 'promise', 'eps ',
'epsf', 'pict' or 'tiff' [for apps that don't have a ps rasteriser
in them], or 'text' as postscript is just text after all.
confused? so am i.

--

now to answer your question about appending to the clip.

if the content -- that i suppose is text -- comes from your app, then
do the homegrown internal scrap dance. this means making your own
routines [i have found containers are good for this]. if the content
is from outside you may, because of your appending, 'degrade' the scrap
and thus it's usefulness...
suppose that the scrap from another app is promised as 'xxxx' a rich
proprietary format proper to the app [generally the apps 'creator'
signature by the way], as 'rtf ', 'styl' and as 'text'. if you take it
as 'text' and append your string. all the information contained
[potentially] in the other formats will be lost for subsequent pastes...

do you follow me?

--

i don't pretend to understand the scrap manager in carbon completely.
it seems complicated and obscure, with unaswered questions. robert
purves seems to know it well, try asking him.

hth a little,
:-j