def set_main_panel(self, widget):
'''Removes any existing main panel widgets, and replaces them with the
argument `widget`.
'''
# Clear existing side panel entries
if len(self._main_panel.children) > 0:
for child in self._main_panel.children:
self._main_panel.remove(child)
# Set new side panel
self._main_panel.add_widget(widget)
self.main_panel = widget
评论列表
文章目录