From c6cb9713466d7fc9fb81cd2c6102bd97e89089b5 Mon Sep 17 00:00:00 2001 From: Manuel QuiƱones Date: Mon, 05 Dec 2011 21:31:28 +0000 Subject: Fix bugs adding conditionals for BrowserNotebook with no pages Signed-off-by: Manuel QuiƱones --- (limited to 'widgets.py') diff --git a/widgets.py b/widgets.py index 608dbb6..3cfdf1e 100644 --- a/widgets.py +++ b/widgets.py @@ -69,11 +69,11 @@ class BrowserNotebook(Gtk.Notebook): empty_page.show() def on_add_tab(self, obj): - raise NotImplementedError, "implement this in the subclass" + raise NotImplementedError("implement this in the subclass") def __on_switch_page(self, notebook, page, page_num): """Don't switch to the extra tab at the end.""" - if page_num == Gtk.Notebook.get_n_pages(self) - 1: + if page_num > 0 and page_num == Gtk.Notebook.get_n_pages(self) - 1: self.handler_block(self._switch_handler) self.set_current_page(-1) self.handler_unblock(self._switch_handler) -- cgit v0.9.1