From 9eb15acf14b5c796bbcf9aefb6096eccb3279e34 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Thu, 4 Nov 2010 23:29:08 +0000 Subject: [PATCH] After creating a new page switch to it svn: r16139 --- src/gui/viewmanager.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gui/viewmanager.py b/src/gui/viewmanager.py index 20ad1dc88..c255d7e73 100644 --- a/src/gui/viewmanager.py +++ b/src/gui/viewmanager.py @@ -1064,19 +1064,17 @@ class ViewManager(CLIManager): page_num = self.page_lookup.get((cat_num, view_num)) if page_num is None: page_def = self.views[cat_num][view_num] - self.page_lookup[(cat_num, view_num)] = self.notebook.get_n_pages() + page_num = self.notebook.get_n_pages() + self.page_lookup[(cat_num, view_num)] = page_num self.__create_page(page_def[0], page_def[1]) - else: - self.notebook.set_current_page(page_num) - - if page_num: - return self.pages[page_num] + + self.notebook.set_current_page(page_num) + return self.pages[page_num] def get_category(self, cat_name): """ Return the category number from the given category name. """ - print ("get_category", cat_name) for cat_num, cat_views in enumerate(self.views): if cat_name == cat_views[0][0].category[1]: return cat_num