title: How to apply MakeModal() method on frame with child dialog
body: <p>I am using wxPython Classic on Python 27. I have my files structure as follow (see codes snippet below):-</p>
  
  <p><strong>frame.py</strong> = this file contains two classes for  frame and dialog (MyFrame1 and MyDialog1 respectively)</p>
  
  <p><strong>main.py</strong> = this file import the classes above and also contains two sub-classes based on the above (MyFrame2 and MyDialog2 respectively).</p>
  
  <p>Now keeping the file structure as it is above, how do I make the Frame window inactive when the dialog window is opened?</p>
  
  <p>How can the MakeModal() method be properly applied on the file arrangement/structure above? All the examples I found so far make uses of two frames instead of a frame and a dialog.</p>
  
  <p><strong>frame.py</strong></p>
  
  <pre><code>import wx
  
  # ************ FRAME 1 ************ #
  # ************ FRAME 1 ************ #
  class MyFrame1 ( wx.Frame ):
  
      def __init__( self, parent ):
          wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 500,300 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )
  
          self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
  
          bSizer = wx.BoxSizer( wx.VERTICAL )
  
          self.child_button = wx.Button( self, wx.ID_ANY, u"Child Frame", wx.DefaultPosition, wx.DefaultSize, 0 )
          bSizer.Add( self.child_button, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
  
  
          self.SetSizer( bSizer )
          self.Layout()
  
          self.Centre( wx.BOTH )
  
          # Connect Events
          self.child_button.Bind( wx.EVT_BUTTON, self.On_child_button )
  
      def __del__( self ):
          pass
  
  
      # Virtual event handlers, overide them in your derived class
      def On_child_button( self, event ):
          event.Skip()
  
  
  
  # ************ DIALOG 1 ************ #
  # ************ DIALOG 1 ************ #
  class MyDialog1 ( wx.Dialog ):
  
      def __init__( self, parent ):
          wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 300,200 ), style = wx.DEFAULT_DIALOG_STYLE )
  
          self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
  
  
          self.Centre( wx.BOTH )
  
          # Connect Events
          self.Bind( wx.EVT_CLOSE, self.onClose )
  
      def __del__( self ):
          pass
  
  
      # Virtual event handlers, overide them in your derived class
      def onClose( self, event ):
          event.Skip()
  </code></pre>
  
  <hr>
  
  <p><strong>main.py</strong></p>
  
  <pre><code>import wx
  from frame import MyFrame1, MyDialog1
  
  
  class MyFrame2(MyFrame1):
      def __init__(self, parent):
          MyFrame1.__init__ (self, parent)
  
      def On_child_button( self, event ):
          MyDialog2(None).Show()
  
  
  class MyDialog2(MyDialog1):
      def __init__(self, parent):
          MyDialog1.__init__ (self, parent)
  
      def onClose(self, event):
          self.Destroy()
  
  
  app = wx.App(0)
  MyFrame2(None).Show()
  app.MainLoop()
  </code></pre>