<p>Using the Apple OS X Cocoa framework, how can I post a <em>sheet</em> (slide-down modal dialog) on the window of another process? </p>

<p><strong>Edit:</strong> Clarified a bit:</p>

<p>My application is a Finder extension to do Subversion version control (<a href="http://scplugin.tigris.org/" rel="nofollow noreferrer">http://scplugin.tigris.org/</a>). Part of my application is a plug-in (a Contextual Menu Item for Finder); the bulk of my application, however, is in a separate daemon proces. For several reasons, we've chosen to put virtually all the code into the daemon; the plug-in only defines the menu itself, and Apple-Events over to the Daemon.</p>

<p>Sometimes, the daemon needs to prompt the user for further information. It can toss a window on-screen for this, but that's disruptive (randomly positioned), and it seems to me the work flow here is legitimately modal, for example "select a file, pick 'commit' from the menu, provide commit comments, do the operation."</p>

<p>Interprocess cooperation (such as passing a reference of some kind) is acceptable: both processes are mine, but I want to avoid binding the sheet's code into the primary process.</p>

[{'answer_id': 65471, 'author': 'nlanza', 'author_id': 9373, 'author_profile': 'https://Stackoverflow.com/users/9373', 'pm_score': 4, 'selected': True, 'text': "<p>Really, it sounds like you're trying to have your inter-process communication happen at the view level, which isn't really how Cocoa generally works. Things will be much easier if you separate your layers a bit more than that.</p>\n\n<p>Why don't you want to put the sheet code into the other process? It's view code, and view code is inherently process-specific. The right thing to do here is probably to add somewhat generic modal-sheet support to your plugin code, and an IPC call that your daemon can make to summon that code. Trying to ship view objects over to the remote process is going to be nightmarish if you can make it work at all.</p>\n\n<p>You're fighting the frameworks with this approach.</p>\n"}, {'answer_id': 66820, 'author': 'Nicholas Riley', 'author_id': 6372, 'author_profile': 'https://Stackoverflow.com/users/6372', 'pm_score': 1, 'selected': False, 'text': "<p>Please don't do this.  Make the interaction nonmodal if at all possible.  Especially in something like a commit, it's much nicer to be able to browse around your files while you're writing commit comments.</p>\n\n<p>OS X does have window groups, but I don't think they can (easily) span applications.</p>\n"}, {'answer_id': 68146, 'author': 'Chris Hanson', 'author_id': 714, 'author_profile': 'https://Stackoverflow.com/users/714', 'pm_score': 2, 'selected': False, 'text': "<p>You can't add a sheet to a window in another process, because you have at most only the most restricted access to the windows in the other process.</p>\n"}, {'answer_id': 88150, 'author': 'Sixten Otto', 'author_id': 16892, 'author_profile': 'https://Stackoverflow.com/users/16892', 'pm_score': 1, 'selected': False, 'text': "<p>Another thing to consider is that in OS X it's possible to have many Finder windows open on the same folder (unlike in OS 9). Even if you <strong>did</strong> have sufficient privileges/APIs to add a sheet to a Finder window, it's not like the modality of that window would prevent the user from being able to continue working with the files.</p>\n\n<p>(My personal opinion as a long-time Mac user is that this kind of interaction would drive me right up the wall.)</p>\n"}]
['https://Stackoverflow.com/questions/65343', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9205/']