pub unsafe fn for_window(
        window: *mut c_void,
        activation_handler: impl 'static + ActivationHandler,
        action_handler: impl 'static + ActionHandler,
    ) -> Self {
        let window = unsafe { &*(window as *const NSWindow) };
        let retained_view = window.contentView().unwrap();
        Self::new_internal(retained_view, activation_handler, action_handler)
    }
Create an adapter that dynamically subclasses the content view
of the specified window.

The action handler will always be called on the main thread.

# Safety

`window` must be a valid, unreleased pointer to an `NSWindow`.

# Panics

This function panics if the specified window doesn't currently have
a content view.
platforms/macos/src/subclass.rs