[libgnome-games-support/andy128k-gtk4: 14/15] Add a child property to GridFrame




commit f3383677227da55a3cb422f4b3e0b376a7afb6e1
Author: Andrey Kutejko <andy128k gmail com>
Date:   Sun Sep 12 16:23:17 2021 +0200

    Add a child property to GridFrame

 games/gridframe.vala | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/games/gridframe.vala b/games/gridframe.vala
index 5d5b743..fd4c121 100644
--- a/games/gridframe.vala
+++ b/games/gridframe.vala
@@ -110,6 +110,23 @@ public class GridFrame : Gtk.Widget
         }
     }
 
+    private Gtk.Widget _child = null;
+    public Gtk.Widget child {
+        get { return _child; }
+
+        set
+        {
+            if (_child == value)
+                return;
+            if (_child != null)
+                _child.unparent ();
+            _child = value;
+            if (_child != null)
+                _child.set_parent (this);
+            queue_resize ();
+        }
+    }
+
     private Gtk.Allocation old_allocation;
 
     public GridFrame (int width, int height)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]