mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 08:41:23 +00:00
Add beginSheet:completionHandler:-related methods:
-[NSWindow beginSheet:completionHandler:] -[NSAlert beginSheetModalForWindow:completionHandler:]
This commit is contained in:
parent
969fe4c870
commit
ea6c43911f
5 changed files with 56 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue