def new_tab(self,x=None): if self.tabs: previous_tab = self.current_tab() current_folder = previous_tab.get_current_folder() else: current_folder = os.curdir tab = Tab(self.notebook,self.statusbar,current_folder) self.tabs.append(tab) self.notebook.set_current_page(len(self.tabs)-1) tab.focus() #reset the flag to indicate that we no longer #have just the original "New Document" tab self.only_first_tab = 0