summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-05 11:54:47 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-06 14:27:45 -0400
commitb21a027d102022b84b40c4f749055033a225e1e4 (patch)
tree99cdb9aa96be6f37681a45cc1ef9342e40a7c5fb /examples
parentcad890ee2904495c6a3507ad5ec48fed52859679 (diff)
downloadgtk+-b21a027d102022b84b40c4f749055033a225e1e4.tar.gz
examples: Use GtkDrawingArea::resize
This signal is a replacement for this (ab)use of the ::size-allocate signal, which is going away.
Diffstat (limited to 'examples')
-rw-r--r--examples/drawing.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/drawing.c b/examples/drawing.c
index be45149e5c..4986f69539 100644
--- a/examples/drawing.c
+++ b/examples/drawing.c
@@ -18,10 +18,10 @@ clear_surface (void)
/* Create a new surface of the appropriate size to store our scribbles */
static void
-size_allocate_cb (GtkWidget *widget,
- GtkAllocation *alloc,
- int baseline,
- gpointer data)
+resize_cb (GtkWidget *widget,
+ int width,
+ int height,
+ gpointer data)
{
if (surface)
{
@@ -153,8 +153,7 @@ activate (GtkApplication *app,
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (drawing_area), draw_cb, NULL, NULL);
- g_signal_connect_after (drawing_area, "size-allocate",
- G_CALLBACK (size_allocate_cb), NULL);
+ g_signal_connect_after (drawing_area, "resize", G_CALLBACK (resize_cb), NULL);
drag = gtk_gesture_drag_new ();
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (drag), GDK_BUTTON_PRIMARY);