def close_state_machine(self, widget, page_number, event=None):
        """Triggered when the close button in the tab is clicked
        """
        page = widget.get_nth_page(page_number)
        for tab_info in self.tabs.values():
            if tab_info['page'] is page:
                state_machine_m = tab_info['state_machine_m']
                self.on_close_clicked(event, state_machine_m, None, force=False)
                return
Triggered when the close button in the tab is clicked