[gtk/abolish-size-allocate: 82/87] tests: Stop using ::size-allocate



commit 1782ef2eeb3271edc1ae654fd3294c2f0a2eec39
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue May 5 12:15:36 2020 -0400

    tests: Stop using ::size-allocate

 tests/testgtk.c               | 19 -------------------
 tests/testoverlaystyleclass.c | 31 -------------------------------
 2 files changed, 50 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 56f5de45d4..8f0cfe22ec 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -4955,23 +4955,6 @@ create_surface_states (GtkWidget *widget)
  * Window sizing
  */
 
-static void
-size_allocate_callback (GtkWidget *widget,
-                       int        width,
-                        int        height,
-                       int        baseline,
-                       gpointer   data)
-{
-  GtkWidget *label = data;
-  gchar *msg;
-
-  msg = g_strdup_printf ("size: %d x %d\n", width, height);
-
-  gtk_label_set_text (GTK_LABEL (label), msg);
-
-  g_free (msg);
-}
-
 static void
 get_ints (GtkWidget *window,
           gint      *a,
@@ -5081,8 +5064,6 @@ window_controls (GtkWidget *window)
   label = gtk_label_new ("<no size>");
   gtk_container_add (GTK_CONTAINER (vbox), label);
 
-  g_signal_connect_after (window, "size-allocate", G_CALLBACK (size_allocate_callback), label);
-
   adjustment = gtk_adjustment_new (10.0, -2000.0, 2000.0, 1.0, 5.0, 0.0);
   spin = gtk_spin_button_new (adjustment, 0, 0);
 
diff --git a/tests/testoverlaystyleclass.c b/tests/testoverlaystyleclass.c
index 8d61b57158..37a8e08c33 100644
--- a/tests/testoverlaystyleclass.c
+++ b/tests/testoverlaystyleclass.c
@@ -1,22 +1,5 @@
 #include <gtk/gtk.h>
 
-static void
-child_size_allocate (GtkWidget    *child,
-                     GdkRectangle *allocation,
-                     gint          baseline,
-                     gpointer      user_data)
-{
-  GtkStyleContext *context;
-  context = gtk_widget_get_style_context (child);
-
-  g_print ("Child %p\nHas left? %d\nHas right? %d\nHas top? %d\nHas bottom? %d\n",
-           child,
-           gtk_style_context_has_class (context, "left"),
-           gtk_style_context_has_class (context, "right"),
-           gtk_style_context_has_class (context, "top"),
-           gtk_style_context_has_class (context, "bottom"));
-}
-
 static gboolean
 overlay_get_child_position (GtkOverlay *overlay,
                             GtkWidget *child,
@@ -94,9 +77,6 @@ main (int argc, char *argv[])
   gtk_widget_set_valign (child, GTK_ALIGN_END);
   gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
 
-  g_signal_connect (child, "size-allocate",
-                    G_CALLBACK (child_size_allocate), overlay);
-
   child = gtk_label_new (NULL);
   str = g_strdup_printf ("%p", child);
   gtk_label_set_text (GTK_LABEL (child), str);
@@ -106,9 +86,6 @@ main (int argc, char *argv[])
   gtk_widget_set_valign (child, GTK_ALIGN_START);
   gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
 
-  g_signal_connect (child, "size-allocate",
-                    G_CALLBACK (child_size_allocate), overlay);
-
   child = gtk_label_new (NULL);
   str = g_strdup_printf ("%p", child);
   gtk_label_set_text (GTK_LABEL (child), str);
@@ -118,9 +95,6 @@ main (int argc, char *argv[])
   gtk_widget_set_valign (child, GTK_ALIGN_CENTER);
   gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
 
-  g_signal_connect (child, "size-allocate",
-                    G_CALLBACK (child_size_allocate), overlay);
-
   child = gtk_label_new (NULL);
   str = g_strdup_printf ("%p", child);
   gtk_label_set_text (GTK_LABEL (child), str);
@@ -132,9 +106,6 @@ main (int argc, char *argv[])
   gtk_widget_set_valign (child, GTK_ALIGN_START);
   gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
 
-  g_signal_connect (child, "size-allocate",
-                    G_CALLBACK (child_size_allocate), overlay);
-
   child = gtk_label_new (NULL);
   str = g_strdup_printf ("%p", child);
   gtk_label_set_text (GTK_LABEL (child), str);
@@ -144,8 +115,6 @@ main (int argc, char *argv[])
   gtk_widget_set_valign (child, GTK_ALIGN_START);
   gtk_overlay_add_overlay (GTK_OVERLAY (overlay), child);
 
-  g_signal_connect (child, "size-allocate",
-                    G_CALLBACK (child_size_allocate), overlay);
   g_signal_connect (overlay, "get-child-position",
                     G_CALLBACK (overlay_get_child_position), child);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]