summaryrefslogtreecommitdiff
path: root/tests/testgrid.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-01-15 23:57:57 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-01-16 14:14:10 -0500
commitba844df6f05a64a0a00c272c0506647616cd1596 (patch)
tree09153df52dd6d416c7119251b6b9a708d247cae9 /tests/testgrid.c
parent0c1ac9add4a7b2a4233a2edf1c521a67822a2af2 (diff)
downloadgtk+-ba844df6f05a64a0a00c272c0506647616cd1596.tar.gz
tests: Stop using ::button-press/release-event
The generic ::event signal works fine here.
Diffstat (limited to 'tests/testgrid.c')
-rw-r--r--tests/testgrid.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/testgrid.c b/tests/testgrid.c
index afd3f12112..67270d76b9 100644
--- a/tests/testgrid.c
+++ b/tests/testgrid.c
@@ -32,13 +32,16 @@ test_widget (const gchar *label, const gchar *color)
static GtkOrientation o;
static gboolean
-toggle_orientation (GtkWidget *window, GdkEventButton *event, GtkGrid *grid)
+toggle_orientation (GtkWidget *window, GdkEvent *event, GtkGrid *grid)
{
- o = 1 - o;
+ if (gdk_event_get_event_type (event) == GDK_BUTTON_PRESS)
+ {
+ o = 1 - o;
- gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), o);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), o);
+ }
- return FALSE;
+ return GDK_EVENT_PROPAGATE;
}
static void
@@ -52,7 +55,7 @@ simple_grid (void)
gtk_window_set_title (GTK_WINDOW (window), "Orientation");
grid = gtk_grid_new ();
gtk_container_add (GTK_CONTAINER (window), grid);
- g_signal_connect (window, "button-press-event", G_CALLBACK (toggle_orientation), grid);
+ g_signal_connect (window, "event", G_CALLBACK (toggle_orientation), grid);
gtk_grid_set_column_spacing (GTK_GRID (grid), 5);
gtk_grid_set_row_spacing (GTK_GRID (grid), 5);