Displaying persistent data with the Join subscriber


The Join subscriber lets you display data over a long time without affecting the buffer rotation.

For example, if you want to display a background image with an animation on top, none of the buffers which contain both animation chunks and image chunks can be reused until the image is no longer displayed.

The Join subscriber lets you copy and return a buffer and circumvent the usual use and return mechanism.

Note: You can also work with the SCEL subscriber or Text subscriber. They allow for a stream header flag that copies a specified chunk out of the stream buffer. See the Attic folder for more information.

Displaying a background image

Displaying a background image with the Join subscriber involves the following basic steps:

  1. Create a chunk file using the Chunkify tool. For the example, use a type of IMAG and MEMTYPE_ANY (the default).

  2. Weave the stream, using the chunk file as one of its elements.

  3. Create and specify a message port at which to receive the specified Join elements.

    MsgPort = InitiJoinPort (joinContextPTR, &MsgPort, `IMAG')

  4. To render and release the image, call GetJoinElement()and ReleaseJoinElement().