gtk-demo: Use gtk_widget_set_can_pick

Use gtk_widget_set_can_pick instead of
overlay-specific functions with the same purpose.
This commit is contained in:
Matthias Clasen 2019-02-21 21:55:56 -05:00
parent f8609efa2b
commit f202707210
2 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ do_overlay (GtkWidget *do_widget)
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), vbox);
gtk_overlay_set_overlay_pass_through (GTK_OVERLAY (overlay), vbox, TRUE);
gtk_widget_set_can_pick (vbox, FALSE);
gtk_widget_set_halign (vbox, GTK_ALIGN_CENTER);
gtk_widget_set_valign (vbox, GTK_ALIGN_CENTER);

View File

@ -66,13 +66,13 @@ do_overlay2 (GtkWidget *do_widget)
image = gtk_picture_new_for_resource ("/overlay2/decor1.png");
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), image);
gtk_overlay_set_overlay_pass_through (GTK_OVERLAY (overlay), image, TRUE);
gtk_widget_set_can_pick (image, FALSE);
gtk_widget_set_halign (image, GTK_ALIGN_START);
gtk_widget_set_valign (image, GTK_ALIGN_START);
image = gtk_picture_new_for_resource ("/overlay2/decor2.png");
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), image);
gtk_overlay_set_overlay_pass_through (GTK_OVERLAY (overlay), image, TRUE);
gtk_widget_set_can_pick (image, FALSE);
gtk_widget_set_halign (image, GTK_ALIGN_END);
gtk_widget_set_valign (image, GTK_ALIGN_END);