Note that there are some explanatory texts on larger screens.

plurals
  1. POAllow views in childWindow to become key without losing focus on parentWindow
    primarykey
    data
    text
    <p>I added a childWindow of a custom subclass of NSWindow to a parentWindow (also a custom subclass of NSWindow). The childWindow has the NSBorderlessWindowMask and canBecomeKeyWindow: is overridden to return YES and canBecomeMainWindow: to return NO.</p> <p>The childWindow is set to resize with the parentWindow. So I want to create the illusion that the views of the childWindow are part of the parentWindow. The main idea is to arrange the document windows created by the document-based application within a main window to provide a tabbed interface (just like in a browser) to switch between the documents.</p> <p>My problem is that whenever I click in one of the views of the childWindow, the parentWindow (the main window) looses focus and the traffic light buttons are getting greyed out. This is obviously contrary to what I want to achieve.</p> <p>I found this answer: <a href="https://stackoverflow.com/questions/4916100/make-nsview-in-nspanel-first-responder-without-key-window-status">Make NSView in NSPanel first responder without key window status</a></p> <p>But even if I override isKeyWindow: (of the main window) to always return YES, the title bar gets greyed out nonetheless when I click into the childWindow.</p> <p>I also tried to follow this advice: <a href="http://www.cocoabuilder.com/archive/cocoa/143945-non-focused-child-window.html" rel="nofollow noreferrer">http://www.cocoabuilder.com/archive/cocoa/143945-non-focused-child-window.html</a></p> <p>But I'm not sure what "include the child window in its responder chain just ahead of its nextResponder" means. With canBecomeKeyWindow: to return NO (for the childWindow), the views within the child never can become key and are always greyed out.</p> <p>Any clue what I am doing wrong?</p> <p>One addition: Is it possible to make the views in the childWindow FirstResponder without giving the childWindow key-status?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload