Comments (3)
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.
from objc.
I want to get current NSView or NSWindow.
Is it possible?
Have you reslove this problem? Do you know the method , thanks
from objc.
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.
from objc.
Related Issues (20)
- Ref conversions HOT 2
- Getting data out of a CVPixelBuffer HOT 18
- please update to node >10 version HOT 1
- Symbol not found with Node 10.11.0 and Electron 4.0 HOT 1
- Delegating HOT 5
- how convert nativeWindowHandle to NSView HOT 8
- how can i import custom framework?
- build fails on npm install --save objc HOT 3
- Support for Node 14.x ??? HOT 2
- How to use NSRange as a Block parameter? HOT 1
- Importing values from IOKit lib exceeds maximum call stack HOT 7
- Unhelpful error message when framework not found HOT 2
- xxxx.apply is not a function
- "Unexpected token 'o'" in type-encodings.js
- Can you use private frameworks with this?
- Can't introspect various symbols (e.g. require('objc').NSTitledWindowMask)
- Can we do an example for synchronizing documents in the icloud multiple devices?
- Install fails
- Support electron 21 / v8 memory cage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from objc.