implementAsBlocking static method
NSPopoverDelegate
implementAsBlocking({
- bool popoverShouldClose_()?,
- bool popoverShouldDetach_()?,
- void popoverDidDetach_()?,
- NSWindow? detachableWindowForPopover_()?,
- void popoverWillShow_(
- NSNotification
- void popoverDidShow_(
- NSNotification
- void popoverWillClose_(
- NSNotification
- void popoverDidClose_(
- NSNotification
- bool $keepIsolateAlive = true,
Builds an object that implements the NSPopoverDelegate protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly. All
methods that can be implemented as blocking listeners will be.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSPopoverDelegate implementAsBlocking({
bool Function(NSPopover)? popoverShouldClose_,
bool Function(NSPopover)? popoverShouldDetach_,
void Function(NSPopover)? popoverDidDetach_,
NSWindow? Function(NSPopover)? detachableWindowForPopover_,
void Function(objc.NSNotification)? popoverWillShow_,
void Function(objc.NSNotification)? popoverDidShow_,
void Function(objc.NSNotification)? popoverWillClose_,
void Function(objc.NSNotification)? popoverDidClose_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(debugName: 'NSPopoverDelegate');
NSPopoverDelegate.popoverShouldClose_.implement(
builder,
popoverShouldClose_,
);
NSPopoverDelegate.popoverShouldDetach_.implement(
builder,
popoverShouldDetach_,
);
NSPopoverDelegate.popoverDidDetach_.implementAsBlocking(
builder,
popoverDidDetach_,
);
NSPopoverDelegate.detachableWindowForPopover_.implement(
builder,
detachableWindowForPopover_,
);
NSPopoverDelegate.popoverWillShow_.implementAsBlocking(
builder,
popoverWillShow_,
);
NSPopoverDelegate.popoverDidShow_.implementAsBlocking(
builder,
popoverDidShow_,
);
NSPopoverDelegate.popoverWillClose_.implementAsBlocking(
builder,
popoverWillClose_,
);
NSPopoverDelegate.popoverDidClose_.implementAsBlocking(
builder,
popoverDidClose_,
);
builder.addProtocol($protocol);
return NSPopoverDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}