Im sure ive parented everything up right buut when i run the code it doesnt show the panels right.

As you can see from the code i want a 3 page notebook on the left half of the screen and a blank panel on the right side but i really cant see why its not working.

any advice is appreciated. thanks.

import wx

class MyPanel(wx.Panel):

    def __init__(self, parent, bgcolor, toolbar=False):
        wx.Panel.__init__(self, parent, wx.ID_ANY)
        self.SetBackgroundColour(bgcolor)

class MainWindow(wx.Frame):

    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id, 'Sample', size = (500, 500))
        mainpanel = wx.Panel(self)

        selectionPanel = wx.Panel(mainpanel, -1)
        selectionPanel = wx.Notebook(selectionPanel, -1)
        panel1 = MyPanel(selectionPanel, "")
        panel2 = MyPanel(selectionPanel, "")
        panel3 = MyPanel(selectionPanel, "")

        selectionPanel.AddPage(panel1, "1")
        selectionPanel.AddPage(panel2, "2")
        selectionPanel.AddPage(panel3, "3")

        orderSpecifics = wx.Panel(self)

        initlay = wx.BoxSizer()
        initlay.Add(selectionPanel, proportion = 1, border = 0)
        initlay.Add(orderSpecifics, proportion = 1, border = 0)

        mainpanel.SetSizer(initlay)
        

app = wx.App(redirect = False)
frame1 = MainWindow(parent = None, id = -1)
frame1.Show()
app.MainLoop()

Sorted it now thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.