aboutsummaryrefslogtreecommitdiff
path: root/templates/mac
diff options
context:
space:
mode:
authorLucifer <[email protected]>2019-12-13 06:35:10 +0530
committerLucifer <[email protected]>2019-12-13 06:35:10 +0530
commit8a35aa08c43211125d8afb607a94165296dfb2f9 (patch)
treec44f457cdae9218eca3621bf0eda1880d22e12c2 /templates/mac
parentc9969c2a2d0e2b171311c359ad9db2f6beca32b1 (diff)
downloadnativekit-8a35aa08c43211125d8afb607a94165296dfb2f9.tar.xz
nativekit-8a35aa08c43211125d8afb607a94165296dfb2f9.zip
Started macOS Development
Added main.js and index.html for macOS Native Kit development
Diffstat (limited to 'templates/mac')
-rw-r--r--templates/mac/index.html12
-rw-r--r--templates/mac/main.js45
2 files changed, 57 insertions, 0 deletions
diff --git a/templates/mac/index.html b/templates/mac/index.html
new file mode 100644
index 0000000..1357638
--- /dev/null
+++ b/templates/mac/index.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
+ <title>macOS Native Kit</title>
+</head>
+<body>
+ <h1>Native Kit macOS</h1>
+</body>
+</html> \ No newline at end of file
diff --git a/templates/mac/main.js b/templates/mac/main.js
new file mode 100644
index 0000000..7d7f099
--- /dev/null
+++ b/templates/mac/main.js
@@ -0,0 +1,45 @@
+// {app} Module to control application life.
+// {BrowserWindow} Module to create native browser window.
+const {app, BrowserWindow} = require('electron')
+
+// Keep a global reference of the window object, if you don't, the window will
+// be closed automatically when the JavaScript object is garbage collected.
+var mainWindow = null;
+
+// Quit when all windows are closed.
+app.on('window-all-closed', function() {
+ // On OS X it is common for applications and their menu bar
+ // to stay active until the user quits explicitly with Cmd + Q
+ if (process.platform != 'darwin') {
+ app.quit();
+ }
+});
+
+// This method will be called when Electron has finished
+// initialization and is ready to create browser windows.
+app.on('ready', function() {
+ // Create the browser window.
+ mainWindow = new BrowserWindow({
+ width: 800,
+ height: 600,
+ minWidth: 500,
+ minHeight: 200,
+ acceptFirstMouse: true,
+ titleBarStyle: 'hidden',
+ frame: false
+ });
+
+ // and load the index.html of the app.
+ mainWindow.loadURL('file://' + __dirname + '/index.html');
+
+ // Open the DevTools.
+ //mainWindow.openDevTools();
+
+ // Emitted when the window is closed.
+ mainWindow.on('closed', function() {
+ // Dereference the window object, usually you would store windows
+ // in an array if your app supports multi windows, this is the time
+ // when you should delete the corresponding element.
+ mainWindow = null;
+ });
+}); \ No newline at end of file