Programmatically clicking the OK button

I'm still working on a framework for regression testing a wxPython GUI.

I have a dialog that starts like this:

···

----
class XMLImport(Dialogs.GenForm):
   """ This window displays a variety of GUI Widgets. """
   def __init__(self,parent,id,title):
       Dialogs.GenForm.__init__(self, parent, id, title, (550,150), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, HelpContext='Import Database')
----

And I want to programmatically click on the OK button.

I know how to programmatically click on a button. But I don't know how to get my hands on the OK button. It seems to be a default button generated by wxPython for a dialog of sylte wx.DEFAULT_DIALOG_STYLE.

How can I get my hands on that button from an instance of the XMLImport dialog?

Thx.

----
Alain Désilets, MASc
Agent de recherches/Research Officer
Institut de technologie de l'information du CNRC /
NRC Institute for Information Technology

alain.desilets@nrc-cnrc.gc.ca
Tél/Tel (613) 990-2813
Facsimile/télécopieur: (613) 952-7151

Conseil national de recherches Canada, M50, 1200 chemin Montréal,
Ottawa (Ontario) K1A 0R6
National Research Council Canada, M50, 1200 Montreal Rd., Ottawa, ON
K1A 0R6

Gouvernement du Canada | Government of Canada

It almost certainly has the ID wx.ID_OK. Use the FindWindowByID method.

···

On 1/11/07, Desilets, Alain <Alain.Desilets@nrc-cnrc.gc.ca> wrote:

I'm still working on a framework for regression testing a wxPython GUI.

I have a dialog that starts like this:

----
class XMLImport(Dialogs.GenForm):
   """ This window displays a variety of GUI Widgets. """
   def __init__(self,parent,id,title):
       Dialogs.GenForm.__init__(self, parent, id, title, (550,150), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, HelpContext='Import Database')
----

And I want to programmatically click on the OK button.

I know how to programmatically click on a button. But I don't know how to get my hands on the OK button. It seems to be a default button generated by wxPython for a dialog of sylte wx.DEFAULT_DIALOG_STYLE.

How can I get my hands on that button from an instance of the XMLImport dialog?