OnFilterEnd

Syntax

OnFilterEnd: (<compound-statement>)?

Return

false if the default OnFilterEnd handler code is to be invoked, or true to prevent the default handler from being invoked (though this latter option is currently ignored in FM 0.4.20).

Description

The OnFilterEnd handler is invoked at the end of each filter run, after all calls to the ForEveryTile, ForEveryRow, ForEveryPixel, and (R, G, B, A)? handlers. The OnFilterEnd handler is a good place to perform any necessary cleanup at the end of a filter run, such as resetting the progress bar indicator.

Default handler

The default OnFilterEnd handler calls (playSoundWave)?(NULL) to terminate any wave file that may still be playing.

Example

You can use the OnFilterEnd handler to reset the progress bar at the end of a filter run.
OnFilterEnd:{
    updateProgress(0, 100);  /* reset the progress bar to 0% */
    return false; /* allow the default OnFilterEnd handler to run also */
}

Also see

handlers, OnFilterStart, ForEveryTile, ForEveryRow, ForEveryPixel, (R, G, B, A)?

Comments

Everyone can add his/her comments about this handler here. Tips for using it are welcome, too.