98 |
- |
1 |
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
|
|
|
2 |
<!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>
|
|
|
3 |
<code class="function">SetCallback</code> registers a callback function. That is, it
|
|
|
4 |
arranges for the caller-provided function to be called at a specific point
|
|
|
5 |
or points inside PHPlot's internal processing.
|
|
|
6 |
</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>
|
|
|
7 |
A PHPlot-defined name for the callback.
|
|
|
8 |
See <a class="xref" href="callbacks.html#callbacks-names" title="4.4.3. Available Callbacks">Section 4.4.3, “Available Callbacks”</a>.
|
|
|
9 |
</p></dd><dt><span class="term"><em class="replaceable"><code>$function</code></em></span></dt><dd><p>
|
|
|
10 |
The function to be called. This can be either the name of a function as a
|
|
|
11 |
string, or a two-element array with an object class instance and method name.
|
|
|
12 |
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.
|
|
|
13 |
</p></dd><dt><span class="term"><em class="replaceable"><code>$arg</code></em></span></dt><dd><p>
|
|
|
14 |
An optional opaque argument passed-through to the callback function when
|
|
|
15 |
PHPlot triggers the callback. If not supplied, the callback function will
|
|
|
16 |
get a NULL argument.
|
|
|
17 |
</p></dd></dl></div></div><div class="refsect1"><a id="idp1377827276"></a><h2>Return Value</h2><p>
|
|
|
18 |
Returns True if the callback has been registered.
|
|
|
19 |
Returns False on error. The only error condition is if the given callback
|
|
|
20 |
reason is not valid. Note that the function name is not validated until
|
|
|
21 |
the callback is triggered.
|
|
|
22 |
</p></div><div class="refsect1"><a id="idp1377828092"></a><h2>Notes</h2><p>
|
|
|
23 |
If a callback is already registered for the given reason, the new callback
|
|
|
24 |
replaces the old one.
|
|
|
25 |
</p><p>
|
|
|
26 |
Refer to <a class="xref" href="callbacks.html" title="4.4. Callbacks">Section 4.4, “Callbacks”</a> for more information on callbacks.
|
|
|
27 |
</p></div><div class="refsect1"><a id="idp1377829388"></a><h2>History</h2><p>
|
|
|
28 |
This function and the callbacks implementation were added in PHPlot-5.0.4
|
|
|
29 |
as an experimental feature. Callbacks were first documented in this manual
|
|
|
30 |
as of PHPlot-5.0.5 and are no longer considered experimental.
|
|
|
31 |
</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>
|