views:

72

answers:

0

I found a code snippet (http://aspn.activestate.com/ASPN/Mail/Message/wxpython-users/3695248) for a "fakemodal" dialog. This works for what I am doing, but I would like to make it act more like a modal dialog.

My problem - I have a main window and a 2nd dialog window. The 2nd dialog is non-modal. I would like to open a sub-window of the 2nd dialog, and have it act modally only for the 2nd dialog, not the main window. That is, the user should still be able to interact with the main window, but not the 2nd dialog (until the sub-window is closed). fakemodal works, but trying to click on the 2nd dialog doesn't respond the same as a modal window (i.e., on XP there is a system beep and the sub-window is focused).

How can I add these features with fakemodal?

FYI, here's the code for fakemodal

def FakeModal(self):
    self.CenterOnParent()
    self.GetParent().Enable(False)
    wx.Dialog.Show(self)
    self.Raise()

then when closing:
def MyClose(self):
        self.GetParent().Enable(True)
        self.Close()

Thanks, Brett