adjustments to electron app
This commit is contained in:
parent
00217305c2
commit
835048132c
1
.gitignore
vendored
1
.gitignore
vendored
@ -15,6 +15,7 @@ clients/win10/app/bld
|
|||||||
clients/win10/*.opendb
|
clients/win10/*.opendb
|
||||||
clients/**/bin/**
|
clients/**/bin/**
|
||||||
clients/**/obj/**
|
clients/**/obj/**
|
||||||
|
clients/electron/projects
|
||||||
|
|
||||||
*.user
|
*.user
|
||||||
*.sw?
|
*.sw?
|
||||||
|
@ -3,14 +3,26 @@ const electron = require('electron')
|
|||||||
const app = electron.app
|
const app = electron.app
|
||||||
// Module to create native browser window.
|
// Module to create native browser window.
|
||||||
const BrowserWindow = electron.BrowserWindow
|
const BrowserWindow = electron.BrowserWindow
|
||||||
|
// pxt toolchain
|
||||||
|
const pxt = require('pxt-core')
|
||||||
|
|
||||||
// Keep a global reference of the window object, if you don't, the window will
|
// 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.
|
// be closed automatically when the JavaScript object is garbage collected.
|
||||||
let mainWindow
|
let mainWindow
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow() {
|
||||||
|
console.log('starting app...')
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
mainWindow = new BrowserWindow({width: 800, height: 600})
|
mainWindow = new BrowserWindow({
|
||||||
|
width: 800, height: 600,
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: false,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
ts.pxt.Util.debug = true;
|
||||||
|
pxt.mainCli("C:/gh/pxt-microbit/clients/electron/node_modules/pxt-microbit", ["serve", "-just"]);
|
||||||
|
|
||||||
// no menu
|
// no menu
|
||||||
mainWindow.setMenu(null);
|
mainWindow.setMenu(null);
|
||||||
|
|
||||||
|
@ -10,5 +10,10 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron-prebuilt": "^1.2.0"
|
"electron-prebuilt": "^1.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"typescript": "1.8.7",
|
||||||
|
"pxt-core": "*",
|
||||||
|
"pxt-microbit": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user