[Image-SIG] Re: Compile errors

Fredrik Lundh fredrik at pythonware.com
Sat May 31 13:20:58 EDT 2003


"doug" <doug at pop.nsacom.net> wrote:

> Unfortunately I cannot for the life of me figure out where to put the
> TK_PHOTO_COMPOSITE_OVERLAY parameter. Can someone please give
> more explicit directions for the C-Ignorant?

if you're C ignorant, I strongly suggest using the
USE_COMPOSITELESS_PHOTO_PUT_BLOCK approach.

otherwise, you're supposed to add an extra 'compRule' argument
to each Tk_PhotoPutBlock() call, after the ones that are already
there.

    Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height);

becomes

    Tk_PhotoPutBlock(handle, blockPtr, x, y, width, height,
        TK_PHOTO_COMPOSITE_OVERLAY);

(the #ifdef/#endif clause shown below is used to make sure that
the code still compiles with older versions of Tk; compare

    http://www.scriptics.com/man/tcl8.0/TkLib/FindPhoto.htm

with

    http://www.scriptics.com/man/tcl8.4/TkLib/FindPhoto.htm

for some background; see the latter for more on the 'compRule'
argument)

> the Tk folks have changed the Tk_PhotoPutBlock interface in 8.4.x.
>
> to fix this, you have to add a TK_PHOTO_COMPOSITE_OVERLAY parameter
> to all three Tk_PhotoPutBlock calls in tkImaging.c.
>
>
> to make it work under older versions as well, change all
>
>     Tk_PhotoPutBlock(...);
>
> calls to
>
>     Tk_PhotoPutBlock(...
> #if (TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION >= 4 || TK_MAJOR_VERSION > 8)
>         , TK_PHOTO_COMPOSITE_OVERLAY
> #endif
>     );
>
> (untested)
>
>
> alternatively (but also untested), you can add a
>
> #define USE_COMPOSITELESS_PHOTO_PUT_BLOCK
>
> to the top of the file (before including the Tcl and Tk libraries)






More information about the Image-SIG mailing list