Herbie,
I dont understand why (as a part of your handler) you dont hide, then close
the sheet, followed by the closing of the parent if need be.
W.
-----Original Message-----
From: H. Gluender [mailto:h@...]
Sent: Wednesday, March 03, 2004 4:11 PM
To: FB Mailing List
Subject: [FB] New kind of crashes with OSX ?
Dear friends of sheet windows,
it took me quite some time to figure out the reason of a quite
annoying kind of crashes that occurs sometimes after a sheet window
closes _together_ with its parent window. (The latter being
essential!)
Here is an explanation and a remedy:
Closing the sheet _after_ its parent window may lead to a crash.
Because events in the sheet are handled asynchronously, it may happen
-- in cases where the clicked OK button not only closes the sheet but
the parent window as well, that the latter closes before the sheet.
Consequently, one must only close the parent window after it has
received the kHICommandOK event that is sent after the sheet is closed.
The remedy requires you to install a "kHICommandOK"-event handler for
the parent window...
A simpler and more conventional solution is to close the "parent"
window first and then to tell the user why this had to happen, e.g.
by a conventional alert.
Hope this is of some worth.
Best
--
Herbie
------------------------
<http://www.gluender.de>
--