def handle_selected_page(self):
        """
        Open the subscription and submission pages subwindows, but close the
        current page if any other type of page is selected.
        """
        if not self.selected_page:
            pass
        if self.selected_page.name in ('subscription', 'submission'):
            # Launch page in a subwindow
            self.selected_page = self.selected_page.loop()
        elif self.selected_page.name in ('subreddit', 'inbox'):
            # Replace the current page
            self.active = False
        else:
            raise RuntimeError(self.selected_page.name)

        Open the subscription and submission pages subwindows, but close the
        current page if any other type of page is selected.
        
rtv/inbox_page.py