Martin Chilvers | 17 Jul 23:07

Re: [TraitsGUI] ChainedWizard _next_wizard_changed() method

Hi there,

I haven't looked into this, but I just thought it would be worth pointing out that Phil Thompson has 
been working on the wizards just lately (to get the Qt version going), and so it may be that a bug 
has crept in under wx....

He is on holiday at the moment, I'll try to take a look at it tomorrow (since its late over here!)...

Martin

Richard Lincoln wrote:
> I would like to create a chained wizard with a first page where I
> select from a list of other wizards and this determines the next
> wizard.  Please find attached an example of what I am trying to
> achieve.
> 
> The problem that I have is that when the next_wizard trait of a
> ChainedWizard is changed the _next_wizard_changed() method calls
> _create_buttons().
> 
> 
>     def _next_wizard_changed(self, old, new):
>         """ Handle the next wizard being changed. """
> 
>         if new is not None:
>             self.controller.next_controller = new.controller
> 
> #        if self.control is not None:
> #            self._create_buttons(self.control)
> #            self._update()
> 
>         return
> 
> As I understand it, _create_buttons() is normally called from
> _create_contents() and returns a sizer which is then added to the main
> sizer.  The _next_wizard_changed() method does not use the returned
> sizer and the created buttons are placed in the top-left corner of the
> dialog.  The main problem is that there is no end to the subsequent
> pages of the wizard and I get the following traceback if I keep
> clicking Next.
> 
> Traceback (most recent call last):
>   File "/home/rwl/python/ets3-2.5-20004/ETS_3.0.0b1/TraitsBackendWX_3.0.0b1/enthought/pyface/ui/wx/wizard/wizard.py",
> line 182, in _on_next
>     self.next()
>   File "/home/rwl/python/ets3-2.5-20004/ETS_3.0.0b1/TraitsGUI_3.0.0b1/enthought/pyface/wizard/i_wizard.py",
> line 74, in next
>     self._show_page(page)
>   File "/home/rwl/python/ets3-2.5-20004/ETS_3.0.0b1/TraitsBackendWX_3.0.0b1/enthought/pyface/ui/wx/wizard/wizard.py",
> line 109, in _show_page
>     if not panel.has_layer(page.id):
> AttributeError: 'NoneType' object has no attribute 'id'
> 
> 
> If I comment the lines out as above I get no problems with my wizards
> or with the example provided with Pyface.  I don't fully understand
> how the wizards work, but can this be done?
> 
> Regards,
> 
> Richard
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Enthought-dev mailing list
> Enthought-dev@...
> https://mail.enthought.com/mailman/listinfo/enthought-dev

Gmane