[gtk/abolish-size-allocate: 6/10] gtk-demo: Use GtkDrawingArea::resize
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/abolish-size-allocate: 6/10] gtk-demo: Use GtkDrawingArea::resize
- Date: Tue, 5 May 2020 16:44:22 +0000 (UTC)
commit 040c221820496c86d73f12b9da19e9e90bf2cc47
Author: Matthias Clasen <mclasen redhat com>
Date: Tue May 5 11:53:25 2020 -0400
gtk-demo: Use GtkDrawingArea::resize
This signal is a replacement for this (ab)use
of ::size-allocate.
demos/gtk-demo/drawingarea.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/demos/gtk-demo/drawingarea.c b/demos/gtk-demo/drawingarea.c
index dd7380b63c..5404f53a1c 100644
--- a/demos/gtk-demo/drawingarea.c
+++ b/demos/gtk-demo/drawingarea.c
@@ -42,7 +42,9 @@ create_surface (GtkWidget *widget)
}
static void
-scribble_size_allocate (GtkWidget *widget)
+scribble_resize (GtkWidget *widget,
+ int width,
+ int height)
{
create_surface (widget);
}
@@ -242,8 +244,8 @@ do_drawingarea (GtkWidget *do_widget)
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), scribble_draw, NULL, NULL);
gtk_frame_set_child (GTK_FRAME (frame), da);
- g_signal_connect (da, "size-allocate",
- G_CALLBACK (scribble_size_allocate), NULL);
+ g_signal_connect (da, "resize",
+ G_CALLBACK (scribble_resize), NULL);
drag = gtk_gesture_drag_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (drag), GDK_BUTTON_PRIMARY);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]