-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get NSView or NSWindow? #31
Comments
Not sure what you mean, tbh. It seems to me like that's something that would fall into the scope of AppKit, rather than this library. |
Have you reslove this problem? Do you know the method , thanks |
This is essentially how you'd do it: // Import AppKit to get access to its symbols (like NSApplication)
const objc = require('objc');
objc.import('AppKit');
// Once the application has started, and a window is available, you
// can get a reference to it like this:
const mainWindow = objc.NSApplication.sharedApplication().mainWindow(); For an example of starting up an application from scratch, see #43 (where I actually initialise the NSWindow myself, so getting a reference to it is easy). If you want to control an already-running app using this (which it seems many Electron users do), I have no idea whether that's even possible (if nothing else due to macOS sandboxing apps from each other). It would be easiest to start up and manage the entire app using this framework rather than attach to an existing one. |
I want to get current NSView or NSWindow.
Is it possible?
The text was updated successfully, but these errors were encountered: