Wxpython - remove tabs in application
Question: I have a application which I have previously been using multiple tabs. I have
since changed the application and now only need a single panel. My issue is I
can't seem to figure out how I get rid of the redundant tabs and revert to a
single panel. Removing the `self.tabbed` in line 12 and 13 just result in a
very odd looking panel, everything squashed to the corner. Below is the
current tabbed code, I have removed lots of irrelevant code / classes, etc.
What would be the most efficient way without effecting too much code?

UPDATE 1:

I have updated the below code, so it now runs.

    
    
    import wx
    import wx.lib.agw.aui as aui
    import wx.stc as stc
    import os
    import platform
    import time
    systemType = platform.system()
    if systemType == "Windows":
        import win32wnet
    
    class MainWindow(wx.Frame):
        def __init__(self, parent, id, title):
    
            run_params = {}
            self.run_params = run_params
    
            # OS dependent info
            self.run_params["systemType"] = systemType
            if systemType == "Windows":
                self.run_params["fontSize"] = 8
                self.run_params["fontSize2"] = 7
            else:
                self.run_params["fontSize"] = 10
                self.run_params["fontSize2"] = 9
    
            wx.Frame.__init__(self, parent, id, title, size=(900, 710), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | 
                                                    wx.RESIZE_BOX | 
                                                    wx.MAXIMIZE_BOX))
    
            style = aui.AUI_NB_DEFAULT_STYLE ^ aui.AUI_NB_CLOSE_ON_ACTIVE_TAB
            self.tabbed = aui.AuiNotebook(self, agwStyle=style)
            self.submissions = SubmissionPane(self.tabbed, self, run_params)
    
            self.CreateStatusBar()
            self.tabbed.AddPage(self.submissions, "TAB1")
            menuBar = wx.MenuBar()
    
            self.Centre()
            self.Show()
    
    class SubmissionPane(wx.Panel):
        def __init__(self, parent, frame, run_params):
            wx.Panel.__init__(self, parent)
    
            self.parent = parent
            self.selected_folders = None
            self.params = run_params
            self.frame = frame
    
            main_sizer = wx.BoxSizer(wx.VERTICAL)
            self.top_row_sizer = wx.BoxSizer(wx.HORIZONTAL);
            radio_static_box = wx.StaticBox(self, label='Some Text')
            radio_static_box_sizer = wx.StaticBoxSizer(radio_static_box, wx.HORIZONTAL)
    
            job_static_box = wx.StaticBox(self, label='Some Text')
            job_static_box_sizer = wx.StaticBoxSizer(job_static_box, wx.HORIZONTAL)
    
            '''
            radio_labels = ['Some Text', 'Some Text2']
            self.radio_box = wx.RadioBox(
                    self, -1, "", 
                    choices=radio_labels,
            )
            '''
            self.radio1 = wx.RadioButton(self, label='Some Text', style=wx.RB_GROUP)
            self.radio2 = wx.RadioButton(self, label='Some Text')
            self.radio1.SetValue(True)
    
            radio_static_box_sizer.Add(self.radio1, flag=wx.BOTTOM, border=0)
            radio_static_box_sizer.Add(self.radio2, flag=wx.LEFT, border=10)
            self.top_row_sizer.Add(radio_static_box_sizer, flag=wx.LEFT, border=10)
    
            self.check_box = wx.CheckBox(self, label="Some Text")
            self.check_box.SetValue(False)
    
            if self.params["systemType"] == "Windows":
                self.txtTitle = wx.TextCtrl(self, style=wx.SUNKEN_BORDER, value="Some Text...", size=(200, -1), pos=(306, 14))
            else:
                self.txtTitle = wx.TextCtrl(self, style=wx.SUNKEN_BORDER, value="Some Text...", size=(200, -1), pos=(350, 19))
    
            job_static_box_sizer.Add(self.check_box, flag=wx.LEFT, border=0)
    
            self.top_row_sizer.Add(job_static_box_sizer, flag=wx.LEFT, border=10);
            self.txtTitle.Show(False)
    
            main_sizer.Add(self.top_row_sizer);
            main_sizer.Add((-1, 10))
    
            job_static_box2 = wx.StaticBox(self, label='Some Text')
    
            third_row_sizer = wx.StaticBoxSizer(job_static_box2, wx.HORIZONTAL);
            self.tc_files = wx.TextCtrl(self, size=(375, 25))
            self.buttonGo = wx.Button(self, label='Go')
            self.buttonGo.Bind(wx.EVT_BUTTON, self.OnSubmit)
            third_row_sizer.Add(self.tc_files, flag=wx.RIGHT, border=8)
    
            if self.params["systemType"] == "Windows":
                third_row_sizer.Add(self.buttonGo, flag=wx.LEFT | wx.TOP, border=0)
            else:
                third_row_sizer.Add(self.buttonGo, flag=wx.LEFT | wx.TOP, border=2)
    
            main_sizer.Add(third_row_sizer, flag=wx.LEFT, border=10)
    
            self.log_text22 = wx.ListCtrl(self,size=(875,275),
                             style=wx.LC_REPORT | wx.BORDER_SUNKEN | wx.LC_SINGLE_SEL | wx.LC_VRULES | wx.LC_HRULES)
    
            font = wx.Font(self.params["fontSize2"], wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
            self.log_text22.SetFont(font)
    
            self.log_text22.InsertColumn(1, '1', width=40, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(2, '2', width=50, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(3, '3', width=156)
            self.log_text22.InsertColumn(4, '4', width=332)
            self.log_text22.InsertColumn(5, '5', width=100, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(6, '6', width=82, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(7, '7', width=60, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(8, '8', width=50, format=wx.LIST_FORMAT_CENTRE)
    
            main_sizer.Add((-1, 10))
            list_sizer = wx.BoxSizer(wx.VERTICAL)
            list_sizer.Add(self.log_text22, flag=wx.LEFT, border=10)
            main_sizer.Add(list_sizer)
    
            self.running_log1 = wx.stc.StyledTextCtrl(self, -1, size=(875,175))
            self.running_log1.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font)
            self.running_log1.SetMarginWidth(1, 0)
            self.running_log1.StyleSetBackground(wx.stc.STC_STYLE_DEFAULT, (0,0,0))
            self.running_log1.StyleSetForeground(wx.stc.STC_STYLE_DEFAULT, (0,255,0))
            self.running_log1.StyleClearAll()
    
            main_sizer.Add((-1, 5))
            list_sizer = wx.BoxSizer(wx.VERTICAL)
            list_sizer.Add(self.running_log1, flag=wx.LEFT, border=10)
            main_sizer.Add(list_sizer)
    
            list_sizer.Add((-1, 10))
            self.buttonClose = wx.Button(self, -1, "Quit")
            list_sizer.Add(self.buttonClose, flag=wx.ALIGN_CENTER | wx.TOP | wx.LEFT, border=10)
    
            self.SetBackgroundColour("Light Grey")
    
            self.SetSizer(main_sizer)
    
            self.Show()
    
        def OnSubmit(self, event):
            msg = "Running"
            jobSubmitmsg = wx.BusyInfo(msg, self)
            time.sleep(3)
            jobSubmitmsg = None
    
    app = wx.App(redirect=False)
    MainWindow(None, -1, 'Application')
    app.MainLoop()
    

UPDATE 2:

The below answer works very well. Cheers.


Answer: If you don't want a Notebook at all, then you can just use the SubmissionPane
itself and remove the aui stuff:

    
    
    import wx
    import wx.stc as stc
    import os
    import platform
    import time
    systemType = platform.system()
    if systemType == "Windows":
        import win32wnet
    
    class MainWindow(wx.Frame):
        def __init__(self, parent, id, title):
    
            run_params = {}
            self.run_params = run_params
    
            # OS dependent info
            self.run_params["systemType"] = systemType
            if systemType == "Windows":
                self.run_params["fontSize"] = 8
                self.run_params["fontSize2"] = 7
            else:
                self.run_params["fontSize"] = 10
                self.run_params["fontSize2"] = 9
    
            wx.Frame.__init__(self, parent, id, title, size=(900, 710), style=wx.DEFAULT_FRAME_STYLE & ~ (wx.RESIZE_BORDER | 
                                                    wx.RESIZE_BOX | 
                                                    wx.MAXIMIZE_BOX))
    
            ##########################################################
            # Passed self here and removed the unnecessary second self
            ##########################################################
            self.submissions = SubmissionPane(self, run_params) 
            self.CreateStatusBar()
    
            menuBar = wx.MenuBar()
    
            self.Centre()
            self.Show()
    
    class SubmissionPane(wx.Panel):
        ################################################
        # changed the init here
        ################################################
        def __init__(self, parent, run_params):
            wx.Panel.__init__(self, parent)
    
            self.parent = parent
            self.selected_folders = None
            self.params = run_params
            ################################################
            # changed the ref below
            ################################################
            self.frame = self  
    
            main_sizer = wx.BoxSizer(wx.VERTICAL)
            self.top_row_sizer = wx.BoxSizer(wx.HORIZONTAL);
            radio_static_box = wx.StaticBox(self, label='Some Text')
            radio_static_box_sizer = wx.StaticBoxSizer(radio_static_box, wx.HORIZONTAL)
    
            job_static_box = wx.StaticBox(self, label='Some Text')
            job_static_box_sizer = wx.StaticBoxSizer(job_static_box, wx.HORIZONTAL)
    
            '''
            radio_labels = ['Some Text', 'Some Text2']
            self.radio_box = wx.RadioBox(
                    self, -1, "", 
                    choices=radio_labels,
            )
            '''
            self.radio1 = wx.RadioButton(self, label='Some Text', style=wx.RB_GROUP)
            self.radio2 = wx.RadioButton(self, label='Some Text')
            self.radio1.SetValue(True)
    
            radio_static_box_sizer.Add(self.radio1, flag=wx.BOTTOM, border=0)
            radio_static_box_sizer.Add(self.radio2, flag=wx.LEFT, border=10)
            self.top_row_sizer.Add(radio_static_box_sizer, flag=wx.LEFT, border=10)
    
            self.check_box = wx.CheckBox(self, label="Some Text")
            self.check_box.SetValue(False)
    
            if self.params["systemType"] == "Windows":
                self.txtTitle = wx.TextCtrl(self, style=wx.SUNKEN_BORDER, value="Some Text...", size=(200, -1), pos=(306, 14))
            else:
                self.txtTitle = wx.TextCtrl(self, style=wx.SUNKEN_BORDER, value="Some Text...", size=(200, -1), pos=(350, 19))
    
            job_static_box_sizer.Add(self.check_box, flag=wx.LEFT, border=0)
    
            self.top_row_sizer.Add(job_static_box_sizer, flag=wx.LEFT, border=10);
            self.txtTitle.Show(False)
    
            main_sizer.Add(self.top_row_sizer);
            main_sizer.Add((-1, 10))
    
            job_static_box2 = wx.StaticBox(self, label='Some Text')
    
            third_row_sizer = wx.StaticBoxSizer(job_static_box2, wx.HORIZONTAL);
            self.tc_files = wx.TextCtrl(self, size=(375, 25))
            self.buttonGo = wx.Button(self, label='Go')
            self.buttonGo.Bind(wx.EVT_BUTTON, self.OnSubmit)
            third_row_sizer.Add(self.tc_files, flag=wx.RIGHT, border=8)
    
            if self.params["systemType"] == "Windows":
                third_row_sizer.Add(self.buttonGo, flag=wx.LEFT | wx.TOP, border=0)
            else:
                third_row_sizer.Add(self.buttonGo, flag=wx.LEFT | wx.TOP, border=2)
    
            main_sizer.Add(third_row_sizer, flag=wx.LEFT, border=10)
    
            self.log_text22 = wx.ListCtrl(self,size=(875,275),
                             style=wx.LC_REPORT | wx.BORDER_SUNKEN | wx.LC_SINGLE_SEL | wx.LC_VRULES | wx.LC_HRULES)
    
            font = wx.Font(self.params["fontSize2"], wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)
            self.log_text22.SetFont(font)
    
            self.log_text22.InsertColumn(1, '1', width=40, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(2, '2', width=50, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(3, '3', width=156)
            self.log_text22.InsertColumn(4, '4', width=332)
            self.log_text22.InsertColumn(5, '5', width=100, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(6, '6', width=82, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(7, '7', width=60, format=wx.LIST_FORMAT_CENTRE)
            self.log_text22.InsertColumn(8, '8', width=50, format=wx.LIST_FORMAT_CENTRE)
    
            main_sizer.Add((-1, 10))
            list_sizer = wx.BoxSizer(wx.VERTICAL)
            list_sizer.Add(self.log_text22, flag=wx.LEFT, border=10)
            main_sizer.Add(list_sizer)
    
            self.running_log1 = wx.stc.StyledTextCtrl(self, -1, size=(875,175))
            self.running_log1.StyleSetFont(wx.stc.STC_STYLE_DEFAULT, font)
            self.running_log1.SetMarginWidth(1, 0)
            self.running_log1.StyleSetBackground(wx.stc.STC_STYLE_DEFAULT, (0,0,0))
            self.running_log1.StyleSetForeground(wx.stc.STC_STYLE_DEFAULT, (0,255,0))
            self.running_log1.StyleClearAll()
    
            main_sizer.Add((-1, 5))
            list_sizer = wx.BoxSizer(wx.VERTICAL)
            list_sizer.Add(self.running_log1, flag=wx.LEFT, border=10)
            main_sizer.Add(list_sizer)
    
            list_sizer.Add((-1, 10))
            self.buttonClose = wx.Button(self, -1, "Quit")
            list_sizer.Add(self.buttonClose, flag=wx.ALIGN_CENTER | wx.TOP | wx.LEFT, border=10)
    
            self.SetBackgroundColour("Light Grey")
    
            self.SetSizer(main_sizer)
    
            self.Layout()
    
        def OnSubmit(self, event):
            msg = "Running"
            jobSubmitmsg = wx.BusyInfo(msg, self)
            time.sleep(3)
            jobSubmitmsg = None
    
    app = wx.App(redirect=False)
    MainWindow(None, -1, 'Application')
    app.MainLoop()
    

