From 8642854fc8690a60234c33dffa8d3dc77d8d5f1f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Mon, 28 Aug 2017 05:10:21 +0200 Subject: [PATCH] test parent type when trying to close window --- src/GraphicObjects/Window.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/GraphicObjects/Window.cs b/src/GraphicObjects/Window.cs index e0c97ea9..176e8d90 100644 --- a/src/GraphicObjects/Window.cs +++ b/src/GraphicObjects/Window.cs @@ -391,7 +391,12 @@ namespace Crow protected void close(){ Closing.Raise (this, null); - currentInterface.DeleteWidget (this); + if (Parent is Interface) + (Parent as Interface).DeleteWidget (this); + else if (Parent is Group) + (Parent as Group).RemoveChild (this); + else if (Parent is PrivateContainer) + (Parent as Container).Child = null; } } } -- 2.47.3