[gtk/dnd-gestures-2: 49/63] testtreednd: Convert to GtkDropTarget
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/dnd-gestures-2: 49/63] testtreednd: Convert to GtkDropTarget
- Date: Sat, 4 Jan 2020 03:15:17 +0000 (UTC)
commit 9501beeedb23de2fddf73f90e1cbbe254ff91c60
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jan 2 08:53:33 2020 -0500
testtreednd: Convert to GtkDropTarget
tests/testtreednd.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/tests/testtreednd.c b/tests/testtreednd.c
index 5cf423c9bf..4dfe82fd3b 100644
--- a/tests/testtreednd.c
+++ b/tests/testtreednd.c
@@ -89,11 +89,11 @@ get_dragsource (void)
}
static void
-drag_data_received (GtkWidget *widget,
- GdkDrop *drop,
+drag_data_received (GtkDropTarget *dest,
GtkSelectionData *selda,
gpointer dada)
{
+ GtkWidget *widget = gtk_drop_target_get_target (dest);
gchar *text;
text = (gchar*) gtk_selection_data_get_text (selda);
@@ -106,11 +106,13 @@ get_droptarget (void)
{
GtkWidget *label;
GdkContentFormats *targets;
+ GtkDropTarget *dest;
label = gtk_label_new ("Drop here");
targets = gdk_content_formats_new (entries, G_N_ELEMENTS (entries));
- gtk_drag_dest_set (label, GTK_DEST_DEFAULT_ALL, targets, GDK_ACTION_COPY);
- g_signal_connect (label, "drag-data-received", G_CALLBACK (drag_data_received), NULL);
+ dest = gtk_drop_target_new (GTK_DEST_DEFAULT_ALL, targets, GDK_ACTION_COPY);
+ g_signal_connect (dest, "drag-data-received", G_CALLBACK (drag_data_received), NULL);
+ gtk_drop_target_attach (dest, label);
gdk_content_formats_unref (targets);
return label;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]