"""No modal dialogs in OnInit, only create the main frame.
"""
import wx

class MyFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, 'Frame -- Test03_01', size=(200, 200))
        bf = wx.Button(self, -1, "frame", pos=(10,10))
        bd = wx.Button(self, -1, "dialog", pos=(10,80))
        bf.Bind(wx.EVT_BUTTON, self._MakeFrame)        
        bd.Bind(wx.EVT_BUTTON, self._MakeDialog)
        
    def _MakeFrame(self, evt):
        self.child_frame = MyChildFrame(self)
        self.child_frame.Raise()
        self.child_frame.Show()
    
    def _MakeDialog(self, evt):
        dialog = wx.MessageDialog(self, "does this fix it?", "can you see the frame?", wx.YES_NO | wx.ICON_QUESTION)
        dialog.ShowModal()
        dialog.Destroy()
        
class MyChildFrame(wx.Frame):
    def __init__(self, parent):
        wx.Frame.__init__(self, parent, -1, 'Child Frame', size=(300, 300))


if __name__ == '__main__':
    app = wx.App()
    frame = MyFrame()
    frame.Show()
    app.SetTopWindow(frame)
    app.MainLoop()