From 06f6f598a29904e34e622f5e834b3554dcfa074a Mon Sep 17 00:00:00 2001 From: Qua-non Date: Tue, 7 Aug 2012 02:58:39 +0530 Subject: [PATCH] UIX:ScreenManager: ensure screen is orphaned before before adding it to screenmanager --- kivy/uix/screenmanager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kivy/uix/screenmanager.py b/kivy/uix/screenmanager.py index 927efb905..2d451002c 100644 --- a/kivy/uix/screenmanager.py +++ b/kivy/uix/screenmanager.py @@ -580,6 +580,9 @@ class ScreenManager(FloatLayout): self.current = screen.name def real_add_widget(self, *l): + # ensure screen is removed from it's previous parent before adding' + if l[0].parent: + l[0].parent.remove_widget(l[0]) super(ScreenManager, self).add_widget(*l) def real_remove_widget(self, *l):