Previously, unless you were using a sheet alert, there was no way to set a custom dismissal handler for an alert. In Cocoa alerts are synchronous, in Cappuccino they are asynchronous, which meant that a single dismissal handler had to handle all possible non-sheet alerts.
This commit adds several methods which add two ways to specify a custom dismissal handler: via delegate/selector, and via a block (function). The new methods are:
setDidEndSelector:
runModalWithDidEndBlock:
beginSheetModalForWindow:didEndBlock:
Note that didEnd blocks are transient and take precedence over didEnd selectors.
The CPAlertTest demo was updated to fix some bugs and added the ability to run the tests using blocks.
* Note that this does not match the Cocoa documentation, but a whole bunch of event handling code relies on this behavior, so I have to keep it the way it was.
* Fixed dequeue flag in CPApplication -runModalSession:
* Added a window title in CPAlertTest
Fixed a bug in CPWindow where the didEndSelector was reset too early. This bug was visible only when trying to chain sheet alerts.
Fixed a local/instance variable conflict in AttachedSheet/AppController.j