+
+ // Handle the first responder
+ NSWindow *window = [cocoaView window];
+ if(window != nil)
+ {
+ NSResponder *firstResponder = [window firstResponder];
+ if([firstResponder isKindOfClass:[NSView class]] && [(NSView*)firstResponder isDescendantOf:cocoaView])
+ {
+ BOOL didResign = [window makeFirstResponder:nil];
+ // If the current first responder (one of our subviews) refuses to give
+ // up its status, then fail now and don't hide this view
+ if(didResign == NO)
+ return false;
+ }
+ }
+
+ // Create a new view to stand in for the real one (via wxWindowCocoaHider) and replace
+ // the real one with the stand in.