Capture close event of a tab in an aui.notebook

Hello,

I'd like to capture a close event of a tab in an aui.notebook.

The objective is that when the user closes a tab, several variables are updated.
I tried on and on without success.

Here is what I think I should do:

#When the tab is created
self.notebook.AddPage(self.page,"PageLabel")

# Then I try to bind the newly created tab with the close event
self.page.Bind(wx.EVT_CLOSE,self.DestroyTab)

# Then I define the function

def DestroyTab(self,event):

# I do the updates on other variables...

# Then
index = event.GetSelection()
index.Destroy()
event.Skip()

Could anybody tell me where I am wrong and give me some tips so that it works

Thanks in advance
Dominique