[gnome-boxes] util-app: Add function to unparent a gtk widget



commit 0cf532798d82a094f2409cc04a7379d177119c7d
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sun Feb 9 11:37:15 2014 +0100

    util-app: Add function to unparent a gtk widget

 src/util-app.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/util-app.vala b/src/util-app.vala
index 80139cf..731004a 100644
--- a/src/util-app.vala
+++ b/src/util-app.vala
@@ -169,6 +169,15 @@ namespace Boxes {
         container.remove_child (actor);
     }
 
+    public void widget_remove (Gtk.Widget widget) {
+        var container = widget.get_parent () as Gtk.Container;
+
+        if (container == null)
+            return;
+
+        container.remove (widget);
+    }
+
     public Osinfo.Device? find_device_by_prop (Osinfo.DeviceList devices, string prop_name, string 
prop_value) {
         var filter = new Osinfo.Filter ();
         filter.add_constraint (prop_name, prop_value);


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