+#include "gtk/gtkdnd.h"
+#include "gtk/gtkselection.h"
+
+// ----------------------------------------------------------------------------
+// "drag_leave"
+// ----------------------------------------------------------------------------
+
+static void target_drag_leave( GtkWidget *WXUNUSED(widget),
+ GdkDragContext *WXUNUSED(context),
+ guint WXUNUSED(time) )
+{
+ printf( "leave.\n" );
+}
+
+// ----------------------------------------------------------------------------
+// "drag_motion"
+// ----------------------------------------------------------------------------
+
+static gboolean target_drag_motion( GtkWidget *WXUNUSED(widget),
+ GdkDragContext *context,
+ gint WXUNUSED(x),
+ gint WXUNUSED(y),
+ guint time )
+{
+ printf( "motion.\n" );
+ gdk_drag_status( context, context->suggested_action, time );
+ return TRUE;
+}
+
+// ----------------------------------------------------------------------------
+// "drag_drop"
+// ----------------------------------------------------------------------------
+
+static gboolean target_drag_drop( GtkWidget *widget,
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ guint time )
+{
+ printf( "drop at: %d,%d.\n", x, y );
+
+ if (context->targets)
+ {
+ gtk_drag_get_data( widget,
+ context,
+ GPOINTER_TO_INT (context->targets->data),
+ time );
+ }
+ return FALSE;
+}
+
+// ----------------------------------------------------------------------------
+// "drag_data_received"
+// ----------------------------------------------------------------------------
+
+static void target_drag_data_received( GtkWidget *WXUNUSED(widget),
+ GdkDragContext *context,
+ gint x,
+ gint y,
+ GtkSelectionData *data,
+ guint WXUNUSED(info),
+ guint time )
+{
+ printf( "data receive at: %d,%d.\n", x, y );
+
+ if ((data->length >= 0) && (data->format == 8))
+ {
+ wxString str = (const char*)data->data;
+ printf( "Received %s\n.", WXSTRINGCAST str );
+ gtk_drag_finish( context, TRUE, FALSE, time );
+ return;
+ }
+
+ gtk_drag_finish (context, FALSE, FALSE, time);
+}
+
+// ----------------------------------------------------------------------------
+// wxDropTarget
+// ----------------------------------------------------------------------------
+