[Python-checkins] r65305 - in sandbox/trunk/ttk-gsoc/src/idlelib: tabbedpages_new.py tabbedpages_old.py
guilherme.polo
python-checkins at python.org
Wed Jul 30 14:36:43 CEST 2008
Author: guilherme.polo
Date: Wed Jul 30 14:36:43 2008
New Revision: 65305
Log:
Auxiliary last_page method added
Modified:
sandbox/trunk/ttk-gsoc/src/idlelib/tabbedpages_new.py
sandbox/trunk/ttk-gsoc/src/idlelib/tabbedpages_old.py
Modified: sandbox/trunk/ttk-gsoc/src/idlelib/tabbedpages_new.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/idlelib/tabbedpages_new.py (original)
+++ sandbox/trunk/ttk-gsoc/src/idlelib/tabbedpages_new.py Wed Jul 30 14:36:43 2008
@@ -54,6 +54,7 @@
return fpage
def remove_page(self, page_name):
+ """Remove page_name from the notebook."""
if not page_name in self.pages:
raise KeyError("No such TabPage: '%s" % page_name)
@@ -63,6 +64,10 @@
# workaround for bug #1878298 at tktoolkit sf bug tracker
self.event_generate('<Expose>')
+ def last_page(self):
+ """Return the last page in the notebook."""
+ return self.pages[self.tab(self.index('end') - 1)['text']]
+
if __name__ == '__main__':
from Tkinter import Tk
from Tkconstants import TOP, BOTH
Modified: sandbox/trunk/ttk-gsoc/src/idlelib/tabbedpages_old.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/idlelib/tabbedpages_old.py (original)
+++ sandbox/trunk/ttk-gsoc/src/idlelib/tabbedpages_old.py Wed Jul 30 14:36:43 2008
@@ -469,6 +469,9 @@
self._tab_set.set_selected_tab(page_name)
+ def last_page(self):
+ return self.pages[self._pages_order[-1]]
+
# Some methods to make this Notebook compatible with the ttk Notebook
def select(self, page_id=None):
More information about the Python-checkins
mailing list