[gnome-nibbles/arnaudb/wip/gtk4: 32/62] Adapt to GtkBox API.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles/arnaudb/wip/gtk4: 32/62] Adapt to GtkBox API.
- Date: Fri, 19 Jun 2020 14:54:43 +0000 (UTC)
commit cf95327dce431c77aa1c7581808cdd79a1416ef6
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat May 30 18:55:50 2020 +0200
Adapt to GtkBox API.
src/controls.vala | 7 ++++---
src/nibbles-window.vala | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/controls.vala b/src/controls.vala
index a1ec9ae..4ec3ba8 100644
--- a/src/controls.vala
+++ b/src/controls.vala
@@ -36,8 +36,9 @@ private class Controls : Box
internal void prepare (Gee.LinkedList<Worm> worms, Gee.HashMap<Worm, WormProperties> worm_props)
{
- foreach (var grid in grids_box.get_children ())
- grid.destroy ();
+ Widget? widget;
+ while ((widget = grids_box.get_first_child ()) != null)
+ widget.destroy ();
GenericSet<uint> duplicate_keys = new GenericSet<uint> (direct_hash, direct_equal);
GenericSet<uint> encountered_keys = new GenericSet<uint> (direct_hash, direct_equal);
@@ -48,7 +49,7 @@ private class Controls : Box
WormProperties worm_prop = worm_props.@get (worm);
var grid = new ControlsGrid (worm.id, worm_prop, arrow_pixbuf, arrow_key_pixbuf);
- grids_box.add (grid);
+ grid.insert_after (grids_box, /* insert first */ null);
grids.add (grid);
check_for_duplicates (worm_prop.up, ref encountered_keys, ref duplicate_keys);
diff --git a/src/nibbles-window.vala b/src/nibbles-window.vala
index 08490c5..4885444 100644
--- a/src/nibbles-window.vala
+++ b/src/nibbles-window.vala
@@ -135,7 +135,7 @@ private class NibblesWindow : ApplicationWindow
!settings.get_boolean ("sound"));
frame = new AspectFrame (/* x align */ 0.5f, /* y align */ 0.5f, /* ratio ignored */ 0.0f, /* obey
child */ true);
- game_box.pack_start (frame);
+ frame.insert_after (game_box, /* insert first */ null);
/* Create scoreboard */
scoreboard_life = NibblesView.load_pixmap_file ("scoreboard-life.svg", 2 * view.tile_size, 2 *
view.tile_size);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]