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

  • Home
  • SEARCH
  • 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 9029817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:20:13+00:00 2026-06-16T07:20:13+00:00

I am running a wxpython application. Within the application i have a panel that

  • 0

I am running a wxpython application. Within the application i have a panel that contains a notebook with some number of notebook pages/tabs. On a button press (wx.button), i would like to be able to clear one of the notebook pages and replace it with new information provided in my GUI.

I have not seen any kind of Clear() function for wx.Notebook, so I had the thought of deleting the page and creating a new one. However, I cannot seem to get this to work. Here is my code…help??

def UpdatePanel(self):    

    self.Notebook3.DeletePage(0)

    self.newpage = scrolled.ScrolledPanel(self.Notebook3, -1)
    self.newpage.SetupScrolling()
    self.Notebook3.AddPage(self.newpage,"Page Inserted Here")

    # self.Notebook3.InsertPage(0,"Page Inserted Here")
  • 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-16T07:20:14+00:00Added an answer on June 16, 2026 at 7:20 am

    Checkout this code and see how you can adapt it to yours:

    #!/usr/bin/env python
    #-*- coding:utf-8 -*-
    
    import wx
    
    class Page(wx.Panel):
        def __init__(self, parent):
            wx.Panel.__init__(self, parent)
            t = wx.StaticText(self, -1, "THIS IS A PAGE OBJECT", (20,20))
    
    class MainFrame(wx.Frame):
        def __init__(self):
            wx.Frame.__init__(self, None, title="Notebook Remove Pages Example")
    
            pannel  = wx.Panel(self)
            vbox    = wx.BoxSizer(wx.VERTICAL)
            hbox    = wx.BoxSizer(wx.HORIZONTAL)
    
            self.buttonRemove = wx.Button(pannel, id=wx.ID_ANY, label="DELETE", size=(80, 25))
            self.buttonRemove.Bind(wx.EVT_BUTTON, self.onButtonRemove)
            hbox.Add(self.buttonRemove)
    
            self.buttonInsert = wx.Button(pannel, id=wx.ID_ANY, label="CREATE", size=(80, 25))
            self.buttonInsert.Bind(wx.EVT_BUTTON, self.onButtonInsert)
            hbox.Add(self.buttonInsert)
    
            vbox.Add(hbox)
    
            self.Notebook3 = wx.Notebook(pannel)
            vbox.Add(self.Notebook3, 2, flag=wx.EXPAND)
    
            pannel.SetSizer(vbox)
    
            self.pageCounter = 0
            self.addPage()
    
        def addPage(self):
            self.pageCounter += 1
            page      = Page(self.Notebook3)
            pageTitle = "Page: {0}".format(str(self.pageCounter))
            self.Notebook3.AddPage(page, pageTitle)
    
        def onButtonRemove(self, event):   
            self.Notebook3.DeletePage(0)
    
        def onButtonInsert(self, event):   
            self.addPage()
    
    if __name__ == "__main__":
        app = wx.App()
        MainFrame().Show()
        app.MainLoop()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some simple wxpython GUI, and when I click a button click, I
I'm running OS X 10.6.7, Python 2.6, and writing a small wxPython application that
Running SQL Server 2008 (not R2). I have a few reports that have URLs
I am writing a wxPython application that remains open after closing all of its
I have wxPython app which is running on MS Windows and I'd like it
I have an issue with graphing data within wxPython - this code below works
Im trying to start a wxPython app that (I have converted to an exe
I just downloaded wxPython, and was running some of the sample programs from here
Running my script through Devel::NYTProf showed that the following portion of code took up
Running rails 3.2.3 with guard/spork/rspec/factory_girl and have the following in my spec helper: Spork.prefork

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.