wx.aui: resize pane is not working

I have a following code:
pane=self.mgr.GetPane(self.editPanel)
pane.MaxSize((-1, y))

pane.BestSize((x, y))

        pane.MinSize((-1, y))
        self.mgr.Update()

It works great when the pane is small and it is set to be bigger. But it does not getting smaller.
Is there anything else I should do to make it working?

Thanks for help.