Problem of sash in a splitter inserted as page in auiNoteBook

Hello
I searched and did not find the answer to my problem ...
I have a notebook (aui.Notebook) that contail 2 panels splitted with a
splitter ...
I want to fix the initial size of the bottom panel, but I also want to be
able to reduce it if need with mouse.

The issue is that top panel height is always reduced to small height at
creation.

- wx.Notebook works as expected
- aui.AuiNotebook lead to this height sizing issue.

If someone can advise me to find a solution ....

Best regards

Expected result:
<http://wxpython-users.1045709.n5.nabble.com/file/n5717849/x400-cap1.png>

Actual result:
<http://wxpython-users.1045709.n5.nabble.com/file/n5717849/x400-cap2.png>

#!/usr/bin/env python

import sys
import wx.lib.agw.aui as aui
import wx.aui
import wx

import wx.lib.inspection

···

#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
class MainPanel(wx.Panel):

    def __init__(self,
                 panel,color1,color2):

        wx.Panel.__init__(self, panel, -1)

        self.splitter = wx.SplitterWindow(self, -1)

        self.panel1 = wx.Panel(self.splitter, -1)
        self.panel1.SetBackgroundColour(color1)

        self.panel2 = wx.Panel(self.splitter, -1)
        self.panel2.SetBackgroundColour(color2)

        self.splitter.SetMinimumPaneSize(1)
        self.splitter.SplitHorizontally(self.panel1, self.panel2, -300)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.splitter, 1, wx.EXPAND)
        self.SetSizer(sizer)

#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
class MainApp(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None,title="MainFrame", size=(1800, 1000))

        # Option 1 : This does not work ...
        self.notebook = aui.AuiNotebook(self)
        
        # Optioon 2 : This works
        #self.notebook = wx.Notebook(self)

        self.panel1 = MainPanel(self.notebook,"red","green")
        self.notebook.AddPage(self.panel1,"Page1")

        self.panel2 = MainPanel(self.notebook,"orange","blue")
        self.notebook.AddPage(self.panel2,"Page2")

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.notebook, 1, wx.EXPAND)
        self.SetSizer(sizer)

        self.Show()

#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
if __name__ == '__main__':

    app = wx.App(redirect=False)
    MainApp()
    #wx.lib.inspection.InspectionTool().Show()

    app.MainLoop()

--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Problem-of-sash-in-a-splitter-inserted-as-page-in-auiNoteBook-tp5717849.html
Sent from the wxPython-users mailing list archive at Nabble.com.