def METHOD_NAME(self, *args, **kwargs):
    #self.nb.DeleteAllPages()
    #for p in self.pages:
        #p.control.Destroy()
    #    p.dispose()
    #    pass
    while (self.nb.GetPageCount() > 0):
        pg = self.nb.RemovePage(0)
    for p in self.pages:
      p.control.Close()
      #p.dispose()
      pass
    self.pages = []
    for i, layer in enumerate(self.visFr.layers):
        page = layer.edit_traits(parent=self.nb, kind='subpanel')
        self.pages.append(page)
        self.nb.AddPage(page.control, 'Layer %d' % i)
    self.nb.InvalidateBestSize()
    h = self.nb.GetBestSize().height
    self.nb.SetMinSize((200, h))
    self.vsizer.Fit(self.pan)
    self.pan.SetMinSize(self.pan.GetSize())
    self.sizer.Fit(self)
    #print self.pan.GetBestSize(), self.pan.GetSize(), self.GetBestSize(), self.GetSize()
    print('NB best size: ' +  repr(self.nb.GetBestSize()))
    try:
        self.GetParent().GetParent().Layout()
    except AttributeError:
        pass
    #self.nb.AddPage(wx.Panel(self.nb), 'New', imageId=0)