summaryrefslogtreecommitdiff
path: root/tests/testentryicons.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/testentryicons.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/testentryicons.c')
-rw-r--r--tests/testentryicons.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/testentryicons.c b/tests/testentryicons.c
index 796295a61f..14d3cb6b5d 100644
--- a/tests/testentryicons.c
+++ b/tests/testentryicons.c
@@ -100,7 +100,6 @@ main (int argc, char **argv)
GtkWidget *button4;
GIcon *icon;
GdkContentProvider *content;
- GValue value = G_VALUE_INIT;
gboolean done = FALSE;
gtk_init ();
@@ -165,10 +164,7 @@ main (int argc, char **argv)
GTK_ENTRY_ICON_PRIMARY,
"Save a file");
- g_value_init (&value, G_TYPE_STRING);
- g_value_set_string (&value, "Amazing");
- content = gdk_content_provider_new_for_value (&value);
- g_value_unset (&value);
+ content = gdk_content_provider_new_typed (G_TYPE_STRING, "Amazing");
gtk_entry_set_icon_drag_source (GTK_ENTRY (entry),
GTK_ENTRY_ICON_PRIMARY,
content, GDK_ACTION_COPY);