Blame | Last modification | View Log | RSS feed
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><title>SetCallback</title><link rel="stylesheet" type="text/css" href="phplotdoc.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /><link rel="home" href="index.html" title="PHPlot Reference Manual" /><link rel="up" href="reference.html" title="PHPlot Function Reference" /><link rel="prev" href="SetBrowserCache.html" title="SetBrowserCache" /><link rel="next" href="SetDataBorderColors.html" title="SetDataBorderColors" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">SetCallback</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="SetBrowserCache.html">Prev</a> </td><th width="60%" align="center">PHPlot Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="SetDataBorderColors.html">Next</a></td></tr></table><hr /></div><div class="refentry"><a id="SetCallback"></a><div class="titlepage"></div><div class="refnamediv"><h2><span class="refentrytitle">SetCallback</span></h2><p>SetCallback — Registers a callback function</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">$plot->SetCallback(<em class="parameter"><code>$reason</code></em>, <em class="parameter"><code>$function</code></em>, [<span class="optional"><em class="parameter"><code>$arg</code></em></span>])</pre></div><div class="refsect1"><a id="idp1377821860"></a><h2>Description</h2><p><code class="function">SetCallback</code> registers a callback function. That is, itarranges for the caller-provided function to be called at a specific pointor points inside PHPlot's internal processing.</p></div><div class="refsect1"><a id="idp1377822972"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="replaceable"><code>$reason</code></em></span></dt><dd><p>A PHPlot-defined name for the callback.See <a class="xref" href="callbacks.html#callbacks-names" title="4.4.3. Available Callbacks">Section 4.4.3, “Available Callbacks”</a>.</p></dd><dt><span class="term"><em class="replaceable"><code>$function</code></em></span></dt><dd><p>The function to be called. This can be either the name of a function as astring, or a two-element array with an object class instance and method name.See <a class="xref" href="callbacks.html#callbacks-api" title="4.4.1. Callbacks Application Interface">Section 4.4.1, “Callbacks Application Interface”</a> for more information.</p></dd><dt><span class="term"><em class="replaceable"><code>$arg</code></em></span></dt><dd><p>An optional opaque argument passed-through to the callback function whenPHPlot triggers the callback. If not supplied, the callback function willget a NULL argument.</p></dd></dl></div></div><div class="refsect1"><a id="idp1377827276"></a><h2>Return Value</h2><p>Returns True if the callback has been registered.Returns False on error. The only error condition is if the given callbackreason is not valid. Note that the function name is not validated untilthe callback is triggered.</p></div><div class="refsect1"><a id="idp1377828092"></a><h2>Notes</h2><p>If a callback is already registered for the given reason, the new callbackreplaces the old one.</p><p>Refer to <a class="xref" href="callbacks.html" title="4.4. Callbacks">Section 4.4, “Callbacks”</a> for more information on callbacks.</p></div><div class="refsect1"><a id="idp1377829388"></a><h2>History</h2><p>This function and the callbacks implementation were added in PHPlot-5.0.4as an experimental feature. Callbacks were first documented in this manualas of PHPlot-5.0.5 and are no longer considered experimental.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="SetBrowserCache.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="SetDataBorderColors.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">SetBrowserCache </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> SetDataBorderColors</td></tr></table></div></body></html>