[SDL] Scrap for OSX (copy and paste)
E. Wing
ewmailing at gmail.com
Tue Dec 4 16:54:13 PST 2007
This error does not ring a bell. But clarify this, are you trying to
get Sam's scrap code to interoperate with my version? If so, don't do
this. My version is not compatible with Sam's version (because he did
it wrong :P). My modifications post/get directly from the native
clipboard system using the well known text and image types so you can
copy/paste from standard apps like Notepad and Paint. I think Sam was
using some user defined type or something so the only thing that could
exchange data was two instances of scrap.
-Eric
On 12/4/07, Josiah <ravean_uo at hotmail.com> wrote:
> E. Wing <ewmailing <at> gmail.com> writes:
>
> >
> > Attached is my modified version. To compile on OS X, your build system
> > should skip the scrap.c and build scrap_OSX.m instead.
> >
> > -Eric
>
> Thanks Eric, I managed to get it compiling correctly but whenever I try and
> copy
> and past I get an error:
>
> main(467,0xa000ed88) malloc: *** error for object 0xbfffddd0: pointer being
> reallocated was not
> allocated
> main(467,0xa000ed88) malloc: *** set a breakpoint in szone_error to debug
> Text scrap is empty
>
> The code I am using to paste is taken from the original scrap.c and works in
> Windows:
>
> void getclipboard(char *scrap)
> {
> int scraplen;
> char *cp;
> int i;
>
> SDLScrap_PasteFromClipboard(SDLSCRAP_TEXT, &scraplen, &scrap);
> if ( scraplen == 0 ) {
> printf("Text scrap is empty\n");
> } else {
> { /* Convert the scrap from Mac text to UNIX text */
>
> for ( cp=scrap, i=0; i<scraplen; ++cp, ++i ) {
> if ( *cp == '\r' )
> *cp = '\n';
> }
> }
> printf("Scrap is: %s\n", scrap);
> }
> }
>
> Any ideas?
>
> Thanks!
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
More information about the SDL
mailing list