Merge pull request #614 from kivy/screen_addwidg

UIX:ScreenManager: ensure screen is orphaned before before adding it to
This commit is contained in:
Mathieu Virbel 2012-08-07 09:08:04 -07:00
commit 238c33c827
1 changed files with 3 additions and 0 deletions

View File

@ -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):