mirror of https://github.com/kivy/kivy.git
Merge pull request #614 from kivy/screen_addwidg
UIX:ScreenManager: ensure screen is orphaned before before adding it to
This commit is contained in:
commit
238c33c827
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue