| 1 |
<html> |
| 2 |
<head> |
| 3 |
<meta charset="UTF-8"> |
| 4 |
<link rel="stylesheet" href="highlight.min.css"> |
| 5 |
<script src="highlight.min.js"></script><script> |
| 6 |
hljs.configure({languages: ['cpp']}); |
| 7 |
hljs.highlightAll(); |
| 8 |
</script><title>Disconnecting signal handlers</title> |
| 9 |
<link rel="stylesheet" type="text/css" href="style.css"> |
| 10 |
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"> |
| 11 |
<link rel="home" href="index.html" title="Programming with gtkmm 4"> |
| 12 |
<link rel="up" href="chapter-signals.html" title="Appendix B. Signals"> |
| 13 |
<link rel="prev" href="sec-writing-signal-handlers.html" title="Writing signal handlers"> |
| 14 |
<link rel="next" href="sec-overriding-default-signal-handlers.html" title="Overriding default signal handlers"> |
| 15 |
</head> |
| 16 |
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| 17 |
<div class="navheader"> |
| 18 |
<table width="100%" summary="Navigation header"> |
| 19 |
<tr><th colspan="3" align="center">Disconnecting signal handlers</th></tr> |
| 20 |
<tr> |
| 21 |
<td width="20%" align="left"> |
| 22 |
<a accesskey="p" href="sec-writing-signal-handlers.html"><img src="icons/prev.png" alt="Prev"></a> </td> |
| 23 |
<th width="60%" align="center">Appendix B. Signals</th> |
| 24 |
<td width="20%" align="right"> <a accesskey="n" href="sec-overriding-default-signal-handlers.html"><img src="icons/next.png" alt="Next"></a> |
| 25 |
</td> |
| 26 |
</tr> |
| 27 |
</table> |
| 28 |
<hr> |
| 29 |
</div> |
| 30 |
<div class="section"> |
| 31 |
<div class="titlepage"><div><div><h2 class="title" style="clear: both"> |
| 32 |
<a name="sec-disconnecting-signal-handlers"></a>Disconnecting signal handlers</h2></div></div></div> |
| 33 |
|
| 34 |
|
| 35 |
<p> |
| 36 |
Let's take another look at a Signal's <code class="literal">connect</code> method: |
| 37 |
</p> |
| 38 |
|
| 39 |
<pre class="programlisting"><code class="code">sigc::connection signal<void(int)>::connect(const sigc::slot<void(int)>&); |
| 40 |
</code></pre> |
| 41 |
|
| 42 |
<p> |
| 43 |
The returned <code class="classname">sigc::connection</code> can be used to control the |
| 44 |
connection. By keeping a connection object you can disconnect its associated signal |
| 45 |
handler using the <code class="methodname">sigc::connection::disconnect()</code> method. |
| 46 |
</p> |
| 47 |
|
| 48 |
</div> |
| 49 |
<div class="navfooter"> |
| 50 |
<hr> |
| 51 |
<table width="100%" summary="Navigation footer"> |
| 52 |
<tr> |
| 53 |
<td width="40%" align="left"> |
| 54 |
<a accesskey="p" href="sec-writing-signal-handlers.html"><img src="icons/prev.png" alt="Prev"></a> </td> |
| 55 |
<td width="20%" align="center"><a accesskey="u" href="chapter-signals.html"><img src="icons/up.png" alt="Up"></a></td> |
| 56 |
<td width="40%" align="right"> <a accesskey="n" href="sec-overriding-default-signal-handlers.html"><img src="icons/next.png" alt="Next"></a> |
| 57 |
</td> |
| 58 |
</tr> |
| 59 |
<tr> |
| 60 |
<td width="40%" align="left" valign="top">Writing signal handlers </td> |
| 61 |
<td width="20%" align="center"><a accesskey="h" href="index.html"><img src="icons/home.png" alt="Home"></a></td> |
| 62 |
<td width="40%" align="right" valign="top"> Overriding default signal handlers</td> |
| 63 |
</tr> |
| 64 |
</table> |
| 65 |
</div> |
| 66 |
</body> |
| 67 |
</html> |