[wxPython] wxMDIChildFrame causes page fault

I'm having a problem with my wxMDIChildFrame objects and I'm wondering if
some one has seen this behavior before or can point me in the right
direction.

I'm experiencing a python page fault when the user attempts to close a
maximized wxMDIChildFrame that has a sibbling. The page fault doesn't
happen when the children are not maximized and the user closes a child and
it doesn't happen when there is only one child(maximized or minimized).

I'm thinking the code that closes the child when it is maximized is
different than the code that closes the child when it is not maximized.
(More specifically, the code that moves the focus to the sibling window that
has not been closed.)

I don't think I have been tampering with the MDI code at all, but I noticed
that the demo does not suffer from this same crash.

Any ideas as to what might be going on?

  -Mikhael

A Co-worker of mine came up with a solution...

···

---
After some investigations, I was able to come up with a workaround.
The problem is caused by cascading Windows events across invalid
wxWindow variable states.

While the maximized window is destroyed, the other window gets resize
messages so it can maximize, and because it's getting resize messages,
the window that is being destroyed is getting resize messages too, and
talking to its sizer, which no longer has a valid window object at that
point.
Windows is infamous for these kinds of event cascades.

The work around is to trap the close event and remove the sizer before
destroying.
Attached is a patched viewer.py, you'll have to integrate with your current
code.

This info ought to be passed on to the wxWindows crew,
though I don't have a fix for the wxWindows code at this point.
---

----- Original Message -----
From: "Mikhael Loo" <mikhael@lib-sys.com>
To: <wxpython-users@lists.wxwindows.org>
Sent: Thursday, May 31, 2001 5:25 PM
Subject: [wxPython] wxMDIChildFrame causes page fault

I'm having a problem with my wxMDIChildFrame objects and I'm wondering if
some one has seen this behavior before or can point me in the right
direction.

I'm experiencing a python page fault when the user attempts to close a
maximized wxMDIChildFrame that has a sibbling. The page fault doesn't
happen when the children are not maximized and the user closes a child and
it doesn't happen when there is only one child(maximized or minimized).

I'm thinking the code that closes the child when it is maximized is
different than the code that closes the child when it is not maximized.
(More specifically, the code that moves the focus to the sibling window

that

has not been closed.)

I don't think I have been tampering with the MDI code at all, but I

noticed

that the demo does not suffer from this same crash.

Any ideas as to what might be going on?

  -Mikhael

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users