addToBuilder static method

void addToBuilder(
  1. ObjCProtocolBuilder builder, {
  2. bool popoverShouldClose_(
    1. NSPopover
    )?,
  3. bool popoverShouldDetach_(
    1. NSPopover
    )?,
  4. void popoverDidDetach_(
    1. NSPopover
    )?,
  5. NSWindow? detachableWindowForPopover_(
    1. NSPopover
    )?,
  6. void popoverWillShow_(
    1. NSNotification
    )?,
  7. void popoverDidShow_(
    1. NSNotification
    )?,
  8. void popoverWillClose_(
    1. NSNotification
    )?,
  9. void popoverDidClose_(
    1. NSNotification
    )?,
  10. bool $keepIsolateAlive = true,
})

Adds the implementation of the NSPopoverDelegate protocol to an existing objc.ObjCProtocolBuilder.

Note: You cannot call this method after you have called builder.build.

Implementation

static void addToBuilder(
  objc.ObjCProtocolBuilder builder, {
  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,
}) {
  NSPopoverDelegate.popoverShouldClose_.implement(
    builder,
    popoverShouldClose_,
  );
  NSPopoverDelegate.popoverShouldDetach_.implement(
    builder,
    popoverShouldDetach_,
  );
  NSPopoverDelegate.popoverDidDetach_.implement(builder, popoverDidDetach_);
  NSPopoverDelegate.detachableWindowForPopover_.implement(
    builder,
    detachableWindowForPopover_,
  );
  NSPopoverDelegate.popoverWillShow_.implement(builder, popoverWillShow_);
  NSPopoverDelegate.popoverDidShow_.implement(builder, popoverDidShow_);
  NSPopoverDelegate.popoverWillClose_.implement(builder, popoverWillClose_);
  NSPopoverDelegate.popoverDidClose_.implement(builder, popoverDidClose_);
  builder.addProtocol($protocol);
}