Hi folks,
I'm doing a unittest framework for my project. I need to get all
(sub-) window/control objects from top level window. So far many
objects can be retrieved from this way except object of wx.FileDialog.
In the python interactive command line, I can get the correct parent
via fileDialogObj.GetParent() if I create a instance of wx.FileDialog.
But I cannot find this object from its parent via
fileDialogObj.GetParent().GetChildren(). There's no such problem for
wx.Dialog(). Does anybody know why?
PyCrust 0.9.5 - The Flakiest Python Shell
Python 2.5.4 (r254:67916, Jun 13 2009, 22:34:27)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import wx
fdlg = wx.FileDialog(wx.GetApp().GetTopWindow())
fdlg.GetParent() == wx.GetApp().GetTopWindow()
True
fdlg in wx.GetApp().GetTopWindow().GetChildren()
False
dlg = wx.Dialog(wx.GetApp().GetTopWindow())
dlg.GetParent() == wx.GetApp().GetTopWindow()
True
dlg in wx.GetApp().GetTopWindow().GetChildren()
True