I’ve got an application with a large NSView in the middle of a window, and within that view I want to launch and display “Calculator.app” such that it’s confined to that NSView and the Calculator.app’s window size is forced to be the size of this NSView. Is this possible? How would you do it?
(Same question for TextEdit.app etc. I want this for the general case but just using these apps as illustration)
This is not possible. When you launch an application, there is no way to restrict its use of the display. Applications create windows and windows don’t go inside views.
(Well, infeasible or ridiculous but not impossible. You could run a VM inside that view, or load the application and intercept its use of the Cocoa libraries. These are not reasonable options.)
However: If you write an application specifically to do this, there are various ways to embed its display into another application’s view.