[gtk+] colorplane: Don't connect to the configure-event signal



commit 2651b99a131fd7633bb9ce4fbb02aaff75c6dff0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jun 26 14:16:26 2014 -0400

    colorplane: Don't connect to the configure-event signal
    
    We want to stop people from using configure events
    entirely. GtkDrawingArea synthesizes a configure event, but we can just
    make the only user of this functionality stop it, and correct the
    documentation to not mention it.

 gtk/gtkcolorplane.c  |   11 ++++++-----
 gtk/gtkdrawingarea.c |    2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcolorplane.c b/gtk/gtkcolorplane.c
index 4c1bbef..7adb4c9 100644
--- a/gtk/gtkcolorplane.c
+++ b/gtk/gtkcolorplane.c
@@ -172,12 +172,13 @@ create_surface (GtkColorPlane *plane)
   g_free (data);
 }
 
-static gboolean
-plane_configure (GtkWidget         *widget,
-                 GdkEventConfigure *event)
+static void
+plane_size_allocate (GtkWidget     *widget,
+                     GtkAllocation *allocation)
 {
+  GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->size_allocate (widget, allocation);
+
   create_surface (GTK_COLOR_PLANE (widget));
-  return TRUE;
 }
 
 static void
@@ -493,7 +494,7 @@ gtk_color_plane_class_init (GtkColorPlaneClass *class)
   object_class->set_property = plane_set_property;
 
   widget_class->draw = plane_draw;
-  widget_class->configure_event = plane_configure;
+  widget_class->size_allocate = plane_size_allocate;
   widget_class->key_press_event = plane_key_press;
 
   g_object_class_install_property (object_class,
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c
index 4be0756..a9b659e 100644
--- a/gtk/gtkdrawingarea.c
+++ b/gtk/gtkdrawingarea.c
@@ -46,7 +46,7 @@
  *   when the widget is instantiated on a particular display.
  *   (Create GDK resources in response to this signal.)
  *
- * - The #GtkWidget::configure-event signal to take any necessary
+ * - The #GtkWidget::size-allocate signal to take any necessary
  *   actions when the widget changes size.
  *
  * - The #GtkWidget::draw signal to handle redrawing the


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