Add beginSheet:completionHandler:-related methods:

-[NSWindow beginSheet:completionHandler:]
-[NSAlert beginSheetModalForWindow:completionHandler:]
This commit is contained in:
ethanc8 2023-01-03 19:56:16 -06:00 committed by ethanc8
parent 969fe4c870
commit ea6c43911f
5 changed files with 56 additions and 4 deletions

View file

@ -5952,6 +5952,30 @@ current key view.<br />
return nil;
}
- (void)beginSheet:(NSWindow *)sheet
completionHandler:(GSNSWindowDidEndSheetCallbackBlock)handler {
// FIXME
NSInteger ret;
[sheet setParentWindow: self];
self->_attachedSheet = sheet;
[[NSNotificationCenter defaultCenter]
postNotificationName: NSWindowWillBeginSheetNotification
object: self];
ret = [NSApp runModalForWindow: sheet
relativeToWindow: self];
CALL_BLOCK(handler, ret);
[sheet close];
self->_attachedSheet = nil;
[sheet setParentWindow: nil];
[[NSNotificationCenter defaultCenter]
postNotificationName: NSWindowDidEndSheetNotification
object: self];
}
- (CGFloat) backingScaleFactor
{
return 1.0;