<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Properties</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="GTK+ 2.0 Tutorial" HREF="book1.html"><LINK REL="UP" TITLE="Drag-and-drop (DND)" HREF="c1899.html"><LINK REL="PREVIOUS" TITLE="Drag-and-drop (DND)" HREF="c1899.html"><LINK REL="NEXT" TITLE="Functions" HREF="x1939.html"></HEAD ><BODY CLASS="SECT1" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >GTK+ 2.0 Tutorial</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="c1899.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Drag-and-drop (DND)</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="x1939.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="SEC-DRAGANDDROPPROPERTIES" >Properties</A ></H1 ><P >Drag data has the following properties:</P ><P ></P ><UL ><LI ><P > Drag action type (ie GDK_ACTION_COPY, GDK_ACTION_MOVE).</P ></LI ><LI ><P > Client specified arbitrary drag-and-drop type (a name and number pair).</P ></LI ><LI ><P > Sent and received data format type.</P ></LI ></UL ><P >Drag actions are quite obvious, they specify if the widget can drag with the specified action(s), e.g. GDK_ACTION_COPY and/or GDK_ACTION_MOVE. A GDK_ACTION_COPY would be a typical drag-and-drop without the source data being deleted while GDK_ACTION_MOVE would be just like GDK_ACTION_COPY but the source data will be 'suggested' to be deleted after the received signal handler is called. There are additional drag actions including GDK_ACTION_LINK which you may want to look into when you get to more advanced levels of drag-and-drop.</P ><P >The client specified arbitrary drag-and-drop type is much more flexible, because your application will be defining and checking for that specifically. You will need to set up your destination widgets to receive certain drag-and-drop types by specifying a name and/or number. It would be more reliable to use a name since another application may just happen to use the same number for an entirely different meaning.</P ><P >Sent and received data format types (<I CLASS="EMPHASIS" >selection target</I >) come into play only in your request and received data handler functions. The term <I CLASS="EMPHASIS" >selection target</I > is somewhat misleading. It is a term adapted from GTK+ selection (cut/copy and paste). What <I CLASS="EMPHASIS" >selection target</I > actually means is the data's format type (i.e. GdkAtom, integer, or string) that being sent or received. Your request data handler function needs to specify the type (<I CLASS="EMPHASIS" >selection target</I >) of data that it sends out and your received data handler needs to handle the type (<I CLASS="EMPHASIS" >selection target</I >) of data received.</P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="c1899.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="book1.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="x1939.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Drag-and-drop (DND)</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="c1899.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Functions</TD ></TR ></TABLE ></DIV ></BODY ></HTML >