Why wx.lib.agw.aui.AuiNotebook won't veto wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE event?

Hi,

I use a wx.lib.agw.aui.AuiNotebook, and I want to disable the “x” (close) button on tabs, that is I want to prevent the user from closing the tabs. I do:

    self.noteBook = wx.lib.agw.aui.AuiNotebook(self)
    self.noteBook.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnPageClose)

    def OnPageClose(self, event):
        event.Veto()  

However, when I click on “x” button on a tab, the tab is closed. Why doesn’t OnPageClose method have any effect?

Best regards