I wanted to write a very simple program using the either wxWizard or wxWizardPageSimple. I have included below some code that I pulled from
the demo.py wizard example and tweeked a bit to try and make a very simple stand alone Wizard application.
wizard = wxWizard(None, -1, "Hello World")
seems to be the line that is causing problems.
Can anyone see what's wrong with my code? Has anyone ever successfully built a very simple wxWizard based application???
Please reply to me directly as I cannot read the messages on this mailing list.
Thanks,
Darren
···
----------------------------------------------------------------------
from wxPython.wx import *
from wxPython.wizard import *
def makePageTitle(wizPg, title):
sizer = wxBoxSizer(wxVERTICAL)
wizPg.SetSizer(sizer)
title = wxStaticText(wizPg, -1, title)
title.SetFont(wxFont(18, wxSWISS, wxNORMAL, wxBOLD))
sizer.AddWindow(title, 0, wxALIGN_CENTRE|wxALL, 5)
sizer.AddWindow(wxStaticLine(wizPg, -1), 0, wxEXPAND|wxALL, 5)
return sizer
class TitledPage(wxWizardPageSimple):
def __init__(self, parent, title):
wxWizardPageSimple.__init__(self, parent)
self.sizer = makePageTitle(self, title)
wizard = wxWizard(None, -1, "Hello World")
page1 = TitledPage(wizard, "Page 1")
page2 = TitledPage(wizard, "Page 2")
page3 = TitledPage(wizard, "Page 3")
wxWizardPageSimple_Chain(page1, page2)
wxWizardPageSimple_Chain(page2, page3)
wizard.RunWizard(page1)
if wizard.RunWizard(page1):
wxMessageBox("Wizard completed successfully", "That's all folks!")
else:
wxMessageBox("Wizard was cancelled", "That's all folks!")