gtk-demo: Stop using child properties

This commit is contained in:
Matthias Clasen 2019-04-05 03:59:06 +00:00
parent f184393f07
commit 7f6213291d
2 changed files with 21 additions and 12 deletions

View File

@ -27,10 +27,16 @@ toggle_resize (GtkWidget *widget,
is_child1 = (child == gtk_paned_get_child1 (paned));
gtk_container_child_get (GTK_CONTAINER (paned), child,
"resize", &resize,
"shrink", &shrink,
NULL);
if (is_child1)
g_object_get (paned,
"resize-child1", &resize,
"shrink-child1", &shrink,
NULL);
else
g_object_get (paned,
"resize-child2", &resize,
"shrink-child2", &shrink,
NULL);
g_object_ref (child);
gtk_container_remove (GTK_CONTAINER (parent), child);
@ -55,10 +61,16 @@ toggle_shrink (GtkWidget *widget,
is_child1 = (child == gtk_paned_get_child1 (paned));
gtk_container_child_get (GTK_CONTAINER (paned), child,
"resize", &resize,
"shrink", &shrink,
NULL);
if (is_child1)
g_object_get (paned,
"resize-child1", &resize,
"shrink-child1", &shrink,
NULL);
else
g_object_get (paned,
"resize-child2", &resize,
"shrink-child2", &shrink,
NULL);
g_object_ref (child);
gtk_container_remove (GTK_CONTAINER (parent), child);

View File

@ -236,10 +236,7 @@ puzzle_button_pressed (GtkGestureMultiPress *gesture,
return;
}
gtk_container_child_get (GTK_CONTAINER (grid), child,
"left-attach", &l,
"top-attach", &t,
NULL);
gtk_grid_query_child (GTK_GRID (grid), child, &l, &t, NULL, NULL);
if (l == pos_x && t == pos_y)
{