Changing next page on wx.wizard.Wizard

I have a handler bound to wiz.EVT_WIZARD_PAGE_CHANGING which should
change the next page depending upon a control value selected on the current
page. So what I do is:

        cur_page.set_next(desired_page)

However it seems to load the page that was already selected as the next
page before the page changing event came through. Should I assume that it has
already looked at the next_page value at this stage and there is no easy way to
change this? I’d rather not have to change the next page by binding
events to handlers for the controls themselves.

Thanks

Craig

Craig Douglas wrote:

I have a handler bound to wiz.EVT_WIZARD_PAGE_CHANGING which should change the next page depending upon a control value selected on the current page. So what I do is:

            cur_page.set_next(desired_page)

That should probably be

  cur_page.SetNext(desired_page)

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn <robin <at> alldunn.com> writes:

Craig Douglas wrote:
> I have a handler bound to wiz.EVT_WIZARD_PAGE_CHANGING which should
> change the next page depending upon a control value selected on the
> current page. So what I do is:
>
>
>
> cur_page.set_next(desired_page)

That should probably be

  cur_page.SetNext(desired_page)

When I do that I get an attribute error saying the page has no attribute
SetNext.

I've used .set_next() fine to set the initial order of each page (each page is
derived from wx.wizard.PyWizardPage) and can change the next page normally,
but not while handling a .EVT_WIZARD_PAGE_CHANGING event.

Craig Douglas wrote:

Robin Dunn <robin <at> alldunn.com> writes:

Craig Douglas wrote:

I have a handler bound to wiz.EVT_WIZARD_PAGE_CHANGING which should change the next page depending upon a control value selected on the current page. So what I do is:

            cur_page.set_next(desired_page)

That should probably be

  cur_page.SetNext(desired_page)

When I do that I get an attribute error saying the page has no attribute SetNext.

Sorry, I was looking at WizardPageSimple... I'm still not sure where set_next is coming from. There isn't one in the wxPython classes, so I don't know what it is doing.

I've used .set_next() fine to set the initial order of each page (each page is derived from wx.wizard.PyWizardPage) and can change the next page normally, but not while handling a .EVT_WIZARD_PAGE_CHANGING event.

Anyway, if you're using PyWizardPage then you can override GetPage and the wizard will call it when it wants to know what the next page should be. You can make it check and do whatever you need.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!