'Deletes the tab number tab_number, by default the current,
or closes the window if tab is only tab'

def delete_tab(self, button=None, tab_number=None):

    if (self.tab_number == 0):
        if (not self.do_delete_event()):
            self.destroy()
    else:
        if (tab_number is None):
            page = self.notebook.get_current_page()
        else:
            page = self.notebook.get_nth_page(tab_number)
        self.notebook.remove_page(page)
        self.reorder_tab_names()
