Disabling the Next button on a wizard page

Hi,

I'm used to this :
        for o in self.wizard.GetChildren():
            if 'Button' in str(type(o)) and o.GetLabel() == '&Next':
                o.Disable()
If you've got something better, I'd like to have it also !

Regards,
jm

Drew, Matt a écrit :

···

Never mind. I wasn't patient enough. Google is again my friend.

------------------------------------------------------------------------
*From:* Drew, Matt [mailto:Matt.Drew@arraybiopharma.com]
*Sent:* Thursday, September 20, 2007 11:32 AM
*To:* wxPython-users@lists.wxwidgets.org
*Subject:* [wxPython-users] Disabling the Next button on a wizard page

I can't figure out how to disable the Next button on a wx.wizard.PyWizardPage. I want to force the user to fill out all the fields on my wizard page before he can go on to the next step. Has anyone done this successfully?

Hi,

wx.FindWindowById(wx.ID_FORWARD).Disable()

Note that it only works correctly if there is only one window with the id “wx.ID_FORWARD”.

Best regards,

Bruce.

Friday, September 21, 2007, 1:59:33 PM, you wrote:

···

Hi,

I’m used to this :

    for o in self.wizard.GetChildren():
        if 'Button' in str(type(o)) and o.GetLabel() == '&Next':
            o.Disable()

If you’ve got something better, I’d like to have it also !

Regards,

jm

Drew, Matt a écrit :

Never mind. I wasn’t patient enough. Google is again my friend.


From: Drew, Matt [mailto:Matt.Drew@arraybiopharma.com]

Sent: Thursday, September 20, 2007 11:32 AM

To: wxPython-users@lists.wxwidgets.org

Subject: [wxPython-users] Disabling the Next button on a wizard page

I can’t figure out how to disable the Next button on a

wx.wizard.PyWizardPage. I want to force the user to fill out all the

fields on my wizard page before he can go on to the next step. Has

anyone done this successfully?


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org

For additional commands, e-mail:

wxPython-users-help@lists.wxwidgets.org

Best regards,

Bruce mailto:bruce@blazertech.net

Bruce at blazer wrote:

Hi,

wx.FindWindowById(wx.ID_FORWARD).Disable()

Note that it only works correctly if there is only one window with the id "wx.ID_FORWARD".

You can use the window version of that function and then only its children will be recursively searched:

  btn = theWizard.FindWindowById(wx.ID_FORWARD)
  if btn:
    btn.Disable()

···

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

It's simpler than my solution, thanks to you.

···

wx.FindWindowById(wx.ID_FORWARD).Disable()

    btn = theWizard.FindWindowById(wx.ID_FORWARD)
    if btn:
        btn.Disable()