[gtk/child-properties-be-gone: 5/12] gtk-demo: Stop using child properties
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/child-properties-be-gone: 5/12] gtk-demo: Stop using child properties
- Date: Fri, 5 Apr 2019 12:04:02 +0000 (UTC)
commit 7f6213291d8178b7e7fad8dd76e08854d4138686
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Apr 5 03:59:06 2019 +0000
gtk-demo: Stop using child properties
demos/gtk-demo/panes.c | 28 ++++++++++++++++++++--------
demos/gtk-demo/sliding_puzzle.c | 5 +----
2 files changed, 21 insertions(+), 12 deletions(-)
---
diff --git a/demos/gtk-demo/panes.c b/demos/gtk-demo/panes.c
index 675bc5d9ea..e023cd22ba 100644
--- a/demos/gtk-demo/panes.c
+++ b/demos/gtk-demo/panes.c
@@ -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);
diff --git a/demos/gtk-demo/sliding_puzzle.c b/demos/gtk-demo/sliding_puzzle.c
index 60762342c9..dd1bc65151 100644
--- a/demos/gtk-demo/sliding_puzzle.c
+++ b/demos/gtk-demo/sliding_puzzle.c
@@ -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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]