diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-01-01 17:47:34 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-01-16 14:14:10 -0500 |
commit | cbf1ff98f7c2dfe8f0ba4d55872b19dfe93748f9 (patch) | |
tree | 1bcdc4c256e0fe9eaa6d331f4285326ba3cd3e93 /tests/testwindowsize.c | |
parent | fa885f437cef92cf55fadec360321f3c959fed10 (diff) | |
download | gtk+-cbf1ff98f7c2dfe8f0ba4d55872b19dfe93748f9.tar.gz |
tests: Stop using ::configure-event
The generic ::event will do.
Diffstat (limited to 'tests/testwindowsize.c')
-rw-r--r-- | tests/testwindowsize.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/tests/testwindowsize.c b/tests/testwindowsize.c index 495307e550..6e62dd0a60 100644 --- a/tests/testwindowsize.c +++ b/tests/testwindowsize.c @@ -9,17 +9,20 @@ static GtkWidget *default_height_spin; static GtkWidget *resizable_check; static gboolean -configure_event_cb (GtkWidget *window, GdkEventConfigure *event, GtkLabel *label) +configure_event_cb (GtkWidget *window, GdkEvent *event, GtkLabel *label) { - gchar *str; - gint width, height; - - gtk_window_get_size (GTK_WINDOW (window), &width, &height); - str = g_strdup_printf ("%d x %d", width, height); - gtk_label_set_label (label, str); - g_free (str); - - return FALSE; + if (gdk_event_get_event_type (event) == GDK_CONFIGURE) + { + gchar *str; + gint width, height; + + gtk_window_get_size (GTK_WINDOW (window), &width, &height); + str = g_strdup_printf ("%d x %d", width, height); + gtk_label_set_label (label, str); + g_free (str); + } + + return GDK_EVENT_PROPAGATE; } static void @@ -68,7 +71,7 @@ show_dialog (void) //gtk_widget_show (label); gtk_dialog_add_action_widget (GTK_DIALOG (dialog), label, GTK_RESPONSE_HELP); - g_signal_connect (dialog, "configure-event", + g_signal_connect (dialog, "event", G_CALLBACK (configure_event_cb), label); gtk_dialog_run (GTK_DIALOG (dialog)); |