Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8581327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:01:15+00:00 2026-06-11T21:01:15+00:00

I need to create a Python frame as shown in the attached picutre. Let

  • 0

enter image description hereI need to create a Python frame as shown in the attached picutre.

Let me know how to accomplish it.

enter image description here

There are totally 3 blocks..
1.header
2.Navigation
3.Main content..

Navigation block should be mutiple frames..each time you select a option it needs to change..

It has to be more like a menu navigation

import random
import wx

#

class TabPanel1(wx.Panel):
#———————————————————————-
def init(self, parent):
“”””””
wx.Panel.init(self, parent=parent)

    colors = ["red", "blue", "gray", "yellow", "green"]
    self.SetBackgroundColour(random.choice(colors))

panel1 = wx.Panel(self,size=(400,100))
panel1.SetBackgroundColour('#4f5049')

panel1gs = wx.GridSizer(2,2,1,2)

panel1gs.AddMany( [ (wx.StaticText(self,label='FirstLabel'),0,wx.EXPAND),
        (wx.StaticText(self,label='SecondLabel'),0,wx.EXPAND),
        (wx.StaticText(self,label='ThirdLabel'),0,wx.EXPAND),
        (wx.StaticText(self,label='FourthLabel'),0,wx.EXPAND)
        ] )

panel1.SetSizer(panel1gs)

panel2 = wx.Panel(self,size=(400,100))
panel2.SetBackgroundColour('#4f5042')

panel3 = wx.Panel(self,size=(400,100))
panel3.SetBackgroundColour('#4f5042')

    btn = wx.Button(self, label="Press Me")
    sizer = wx.BoxSizer(wx.VERTICAL)
    sizer.Add(btn, 0, wx.ALL, 5)
sizer.Add(panel1, 0, wx.ALL, 5)
sizer.Add(panel2, 0, wx.ALL, 5)
sizer.Add(panel3, 0, wx.ALL, 5)


    self.SetSizer(sizer)

class TabPanel2(wx.Panel):
#———————————————————————-
def init(self, parent):
“”””””
wx.Panel.init(self, parent=parent)

    colors = ["red", "blue", "gray", "yellow", "green"]
    self.SetBackgroundColour(random.choice(colors))

    btn = wx.Button(self, label="Press Me")
    sizer = wx.BoxSizer(wx.VERTICAL)
    sizer.Add(btn, 0, wx.ALL, 10)

    self.SetSizer(sizer)

#

class DemoFrame(wx.Frame):
“””
Frame that holds all other widgets
“””

#----------------------------------------------------------------------
def __init__(self):
    """Constructor"""        
    wx.Frame.__init__(self, None, wx.ID_ANY, 
                      "Notebook Tutorial",
                      size=(800,600)
                      )
    panel = wx.Panel(self)

    notebook = wx.Notebook(panel)
    tabOne = TabPanel1(notebook)
    notebook.AddPage(tabOne, "Tab 1")

    tabTwo = TabPanel2(notebook)
    notebook.AddPage(tabTwo, "Tab 2")

    sizer = wx.BoxSizer(wx.VERTICAL)
    sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5)
    panel.SetSizer(sizer)
    self.Layout()

    self.Show()

———————————————————————-

if name == “main“:
app = wx.App(False)
frame = DemoFrame()
app.MainLoop()

Latest changes
Newcode.py

import random
import wx


########################################################################
class PanelTextCombo(wx.Panel):
     def __init__(self,parent):
    wx.Panel.__init__(self,parent=parent,size=(400,100))

    self.SetBackgroundColour('blue')

    panel1gs = wx.GridSizer(2,2,1,2)

    panel1gs.AddMany( [ (wx.StaticText(panel1,label='FirstLabel'),0),
            (wx.StaticText(panel1,label='SecondLabel'),0),
            (wx.StaticText(panel1,label='ThirdLabel'),0),
            (wx.StaticText(panel1,label='FourthLabel'),0)
            ] )



    panel1.SetSizer(panel1gs)

class TabPanel1(wx.Panel):
    #----------------------------------------------------------------------
    def __init__(self, parent):
        """"""
        wx.Panel.__init__(self, parent=parent)

        colors = ["red", "blue", "gray", "yellow", "green"]
        #self.SetBackgroundColour(random.choice(colors))
    self.SetBackgroundColour('RED')

    #panel1 = wx.Panel(self,size=(400,100))
    #panel1.SetBackgroundColour('blue')

    #panel1gs = wx.GridSizer(2,2,1,2)

    #panel1gs.AddMany( [ (wx.StaticText(panel1,label='FirstLabel'),0),
    #       (wx.StaticText(panel1,label='SecondLabel'),0),
    #       (wx.StaticText(panel1,label='ThirdLabel'),0),
    #       (wx.StaticText(panel1,label='FourthLabel'),0)
    #       ] )

    #panel1.SetSizer(panel1gs)
    panel1 = PanelTextCombo(TabPanel1)
    #panel2 = wx.Panel(self,size=(400,100))
    #panel2.SetBackgroundColour('green')

    #panel3 = wx.Panel(self,size=(400,100))
    #panel3.SetBackgroundColour('#4f5042')

        btn = wx.Button(self, label="Press Me")
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(btn, 0, wx.ALL, 5)
    sizer.Add(panel1, 0, wx.ALL, 5)
    #sizer.Add(panel2, 0, wx.ALL, 5)
    #sizer.Add(panel3, 0, wx.ALL, 5)


        self.SetSizer(sizer)

class TabPanel2(wx.Panel):
    #----------------------------------------------------------------------
    def __init__(self, parent):
        """"""
        wx.Panel.__init__(self, parent=parent)

        colors = ["red", "blue", "gray", "yellow", "green"]
        self.SetBackgroundColour(random.choice(colors))

        btn = wx.Button(self, label="Press Me")
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(btn, 0, wx.ALL, 10)

        self.SetSizer(sizer)

########################################################################
class DemoFrame(wx.Frame):
    """
    Frame that holds all other widgets
    """

    #----------------------------------------------------------------------
    def __init__(self):
        """Constructor"""        
        wx.Frame.__init__(self, None, wx.ID_ANY, 
                          "Notebook Tutorial",
                          size=(800,600)
                          )
        panel = wx.Panel(self)

        notebook = wx.Notebook(panel)
        tabOne = TabPanel1(notebook)
        notebook.AddPage(tabOne, "Tab 1")

        tabTwo = TabPanel2(notebook)
        notebook.AddPage(tabTwo, "Tab 2")

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(notebook, 1, wx.ALL|wx.EXPAND, 5)
        panel.SetSizer(sizer)
        self.Layout()

        self.Show()

#----------------------------------------------------------------------
if __name__ == "__main__":
    app = wx.App(False)
    frame = DemoFrame()
    app.MainLoop()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:01:16+00:00Added an answer on June 11, 2026 at 9:01 pm

    Use a wx.StaticText for the top part as a label, then use a wx.Notebook (or one of the other “book” widgets) for the rest. See the following tutorial:

    • http://www.blog.pythonlibrary.org/2009/12/03/the-book-controls-of-wxpython-part-1-of-2/
    • http://www.blog.pythonlibrary.org/2010/09/15/wxpython-a-simple-notebook-example/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need create clone repository. but I do not know where can I get
I need to create a python module that will be installed on end-user machines.
I need to create a file with python, in the directory: foo/bar/baz/filename.fil The only
Suppose I need to create my own small DSL that would use Python to
To get real concurrency in Ruby or Python, I need to create new processes.
I have a project in Python 2.7 and PyGTK. I need to create a
I am pretty new to python. I need to create a class that loads
I need to create a Python string consisting of non-ascii bytes to be used
I need to create a Python REST/JSON web service for an iOS app to
I need to create 20 variables in Python. That variables are all needed, they

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.