summaryrefslogtreecommitdiff
path: root/tests/testdnd2.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-02-16 14:24:03 +0100
committerBenjamin Otte <otte@redhat.com>2020-02-16 20:10:30 +0100
commit8d2ed36a1bdc4f5c5c7a5eab39562764c69139ce (patch)
treee2abac8376acdf46f9f239d20df3ea6ff83d991b /tests/testdnd2.c
parent762c4602fbb88e3712336426a326adf813e5b280 (diff)
downloadgtk+-8d2ed36a1bdc4f5c5c7a5eab39562764c69139ce.tar.gz
contentprovider: Add gdk_content_provider_new_typed()
Gets around the boilerplate required to create and initialize a GValue by having this function doing it via G_VALUE_COLLECT().
Diffstat (limited to 'tests/testdnd2.c')
-rw-r--r--tests/testdnd2.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/testdnd2.c b/tests/testdnd2.c
index 608c955b03..cfb0da65c5 100644
--- a/tests/testdnd2.c
+++ b/tests/testdnd2.c
@@ -439,21 +439,17 @@ make_spinner (void)
GtkWidget *spinner;
GtkDragSource *source;
GdkContentProvider *content;
- GValue value = G_VALUE_INIT;
spinner = gtk_spinner_new ();
gtk_spinner_start (GTK_SPINNER (spinner));
- g_value_init (&value, G_TYPE_STRING);
- g_value_set_string (&value, "ACTIVE");
- content = gdk_content_provider_new_for_value (&value);
+ content = gdk_content_provider_new_typed (G_TYPE_STRING, "ACTIVE");
source = gtk_drag_source_new ();
gtk_drag_source_set_content (source, content);
g_signal_connect (source, "drag-begin", G_CALLBACK (spinner_drag_begin), spinner);
gtk_widget_add_controller (spinner, GTK_EVENT_CONTROLLER (source));
g_object_unref (content);
- g_value_unset (&value);
return spinner;
}