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 8555113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:02:54+00:00 2026-06-11T15:02:54+00:00

I am trying to create a simple installer using the wxWizard class. On the

  • 0

I am trying to create a simple installer using the wxWizard class. On the first page (page0) I would like to have 3 options

 1. Install (click Next goes to page install1) 
 2. Upgrade (click Next goes to page upgrade1)
 3. Remove (click Next goes to page remove1)

Due to my lack of experience with OOP (and programming in general), I’m unable to understand how to create the page0 object that would do this.

If I create page0 before install1: global name ‘install1’ is not defined
If I create install1 before page0: maximum recursion depth exceeded
If I look at class SkipNextPage at http://xoomer.virgilio.it/infinity77/wxPython/wizard/wx.wizard.html: there is a funky GetNext() method that also don’t understand.

Please help!

import wx
import wx.wizard

class InstallPage_Dyn(wx.wizard.PyWizardPage):
    def __init__(self, parent, title):
        wx.wizard.PyWizardPage.__init__(self, parent)
        self.next = self.prev = None


class InstallPage0(wx.wizard.PyWizardPage):
    def __init__(self, parent, title):
        wx.wizard.PyWizardPage.__init__(self, parent)
        self.next = self.prev = None
        self.box = wx.RadioBox (self, -1, 'Choose one of the options below and hit Next\n', choices=['Install','Upgrade','Remove'], style = wx.VERTICAL | wx.EXPAND)

        # Set Next button based on user choice
        self.box.Bind(wx.EVT_RADIOBOX, self.SetNext(install1))

    # Setter and getter methods to specify Next and Previous buttons#     
    def SetNext(self, next):
        userchoice = self.box.GetSelection()
        if userchoice == 0: 
            self.SetNext(install1)
        elif userchoice == 1:
            self.SetNext(upgrade1)
        elif userchoice == 2:
            self.SetNext(remove1)

    def SetPrev(self, prev):
        return self.prev

    def GetNext(self):
        return self.next

    def GetPrev(self):
        return self.prev


# Define application and create the wizard
app = wx.App()

wizard = wx.wizard.Wizard(None, -1, "Installer")
wizard.SetPageSize((500,350))

# User selected install. Create the pages
install1 = InstallPage_Dyn(wizard, "Install")
upgrade1 = InstallPage_Dyn(wizard, "Upgrade")
remove1 = InstallPage_Dyn(wizard, "Remove")

# Create page instances
page0 = InstallPage0(wizard, "Installer")

wizard.RunWizard(page0)
  • 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-11T15:02:55+00:00Added an answer on June 11, 2026 at 3:02 pm

    Try this

    class InstallPage_Dyn(wx.wizard.PyWizardPage):
        def __init__(self, parent, title):
            wx.wizard.PyWizardPage.__init__(self, parent)
            self.title = wx.StaticText(self,-1,title)
            self.title.SetFont(wx.Font(40,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_BOLD))
            self.next = self.prev = None
        def SetPrev(self,prev):
            self.prev = prev
        def GetPrev(self):
            return self.prev
    
    class InstallPage0(wx.wizard.PyWizardPage):
        def __init__(self, parent, title,optional_panels = {}):
            wx.wizard.PyWizardPage.__init__(self, parent)
            self.prev = self
            self.next = optional_panels.values()[0]
            self.box = wx.RadioBox (self, -1, 'Choose one of the options below and hit Next\n', choices=optional_panels.keys(), style = wx.VERTICAL | wx.EXPAND)
            self.opts = optional_panels.keys()
            self.pages   = optional_panels.values()
            for p in self.pages:
                p.SetPrev(self)
            self.next = self.pages[0]
            self.optional_panels = optional_panels
    
        def GetNext(self):
            return self.pages[self.box.GetSelection()]
        def GetPrev(self):
            return self.prev
    ...
    page0 = InstallPage0(wizard, "Installer",{'install':install1,'upgrade':upgrade1,'remove':remove1})
    
    wizard.RunWizard(page0)
    #app.MainLoop()
    

    here is the full code … name it wiz.py and run it

    import wx
    import wx.wizard
    
    class InstallPage_Dyn(wx.wizard.PyWizardPage):
        def __init__(self, parent, title):
            wx.wizard.PyWizardPage.__init__(self, parent)
            self._title = title
            self.title = wx.StaticText(self,-1,title)
            self.title.SetFont(wx.Font(40,wx.FONTFAMILY_DEFAULT,wx.FONTSTYLE_NORMAL,wx.FONTWEIGHT_BOLD))
            self.next = self.prev = None
        def SetPrev(self,prev):
            self.prev = prev
        def GetPrev(self):
            return self.prev
    
    class InstallPage0(wx.wizard.PyWizardPage):
        def __init__(self, parent, title,optional_panels = {}):
            wx.wizard.PyWizardPage.__init__(self, parent)
            self.prev = self
            self.next = optional_panels[0]
            options = [p._title for p in optional_panels]
            self.box = wx.RadioBox (self, -1, 'Choose one of the options below and hit Next\n', choices=options, style = wx.VERTICAL | wx.EXPAND)
            self.pages   = optional_panels
            for p in self.pages:
                p.SetPrev(self)
            self.next = install1
            self.optional_panels = optional_panels
        def SetPrev(self, prev):
            self.prev = prev
            return self.prev
        def GetNext(self):
            return self.pages[self.box.GetSelection()]
        def GetPrev(self):
            return self.prev
    
    
    # Define application and create the wizard
    app = wx.App(redirect=False)
    
    wizard = wx.wizard.Wizard(None, -1, "Installer")
    wizard.SetPageSize((500,350))
    
    # User selected install. Create the pages
    install1 = InstallPage_Dyn(wizard, "Install")
    upgrade1 = InstallPage_Dyn(wizard, "Upgrade")
    remove1 = InstallPage_Dyn(wizard, "Remove")
    
    # Create page instances
    page0 = InstallPage0(wizard, "Installer",[install1,upgrade1,remove1])
    
    wizard.RunWizard(page0)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a (hopefully) simple installer using WIX, however it seems I'm
i'm trying to create a simple 3-2-1 counter. i would like to display the
Im trying to create a simple pan and zoom app using silverlight 4, but
I'm trying to create a simple widget to retrieve a users feeds, I have
I am trying to create a simple about page that uses JQuery click to
I am trying to create a simple program using Gstreamer to take the input
I'm trying to create a simple web page that resembles the following: I've got
I was trying to create an simple database-driven application in Visual Basic using Visual
I am trying to create an installer using Package Maker, which installs a plugin
I'm trying create a simple background periodic task using Django-Celery-RabbitMQ combination. I installed Django

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.