diff --git a/pyxel/ui/widget.py b/pyxel/ui/widget.py
index <HASH>..<HASH> 100644
--- a/pyxel/ui/widget.py
+++ b/pyxel/ui/widget.py
@@ -68,7 +68,7 @@ class Widget:
     def parent(self, value):
         self._parent = value
 
-        if value:
+        if value and self not in value._children:
             value._children.append(self)
 
     @property
Added the check code for the parent property