<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Chapter 16. Drag and Drop</title> <link rel="stylesheet" href="style.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.73.2"> <link rel="start" href="index.html" title="Programming with gtkmm"> <link rel="up" href="index.html" title="Programming with gtkmm"> <link rel="prev" href="ch15s07.html" title="Example Application: Creating a Clock with Cairo"> <link rel="next" href="ch16s02.html" title="Methods"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr><th colspan="3" align="center">Chapter 16. Drag and Drop</th></tr> <tr> <td width="20%" align="left"> <a accesskey="p" href="ch15s07.html"><img src="../icons/prev.png" alt="Prev"></a> </td> <th width="60%" align="center"> </th> <td width="20%" align="right"> <a accesskey="n" href="ch16s02.html"><img src="../icons/next.png" alt="Next"></a> </td> </tr> </table> <hr> </div> <div class="chapter" lang="en"> <div class="titlepage"><div><div><h2 class="title"> <a name="sec-draganddrop"></a>Chapter 16. Drag and Drop</h2></div></div></div> <div class="toc"> <p><b>Table of Contents</b></p> <ul> <li><span class="sect1"><a href="ch16.html#id2586630">Sources and Destinations</a></span></li> <li><span class="sect1"><a href="ch16s02.html">Methods</a></span></li> <li><span class="sect1"><a href="ch16s03.html">Signals</a></span></li> <li><span class="sect1"><a href="ch16s04.html">DragContext</a></span></li> <li><span class="sect1"><a href="ch16s05.html">Example</a></span></li> </ul> </div> <p> <code class="classname">Gtk::Widget</code> has several methods and signals which are prefixed with "drag_". These are used for Drag and Drop. </p> <div class="sect1" lang="en"> <div class="titlepage"><div><div><h2 class="title" style="clear: both"> <a name="id2586630"></a>Sources and Destinations</h2></div></div></div> <p> Things are dragged from <code class="literal">sources</code> to be dropped on <code class="literal">destinations</code>. Each source and destination has infomation about the data formats that it can send or receive, provided by <code class="classname">Gtk::TargetEntry</code> items. A drop destination will only accept a dragged item if they both share a compatible <code class="classname">Gtk::TargetEntry</code> item. Appropriate signals will then be emitted, telling the signal handlers which <code class="classname">Gtk::TargetEntry</code> was used. </p> <p> <code class="classname">Gtk::TargetEntry</code> objects contain this information: </p> <div class="itemizedlist"><ul type="disc"> <li><p>target: A name, such as "STRING"</p></li> <li><p>info: An identifier which will be sent to your signals to tell you which TargetEntry was used.</p></li> <li><p>flags: TODO</p></li> </ul></div> <p> </p> </div> </div> <div class="navfooter"> <hr> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"> <a accesskey="p" href="ch15s07.html"><img src="../icons/prev.png" alt="Prev"></a> </td> <td width="20%" align="center"> </td> <td width="40%" align="right"> <a accesskey="n" href="ch16s02.html"><img src="../icons/next.png" alt="Next"></a> </td> </tr> <tr> <td width="40%" align="left" valign="top">Example Application: Creating a Clock with Cairo </td> <td width="20%" align="center"><a accesskey="h" href="index.html"><img src="../icons/home.png" alt="Home"></a></td> <td width="40%" align="right" valign="top"> Methods</td> </tr> </table> </div> </body> </html>