Commit c7a12d71 authored by rattanaporn  saysee's avatar rattanaporn saysee

Desktop Application Development

parent f54d44da
<!-- <h2> Wow </h2> -->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<style>
body {
background-color: #CCFFFF;
}
</style>
</head>
<body>
<h1><font face="Courier New"><font color="Mediumorchid">สวัสดีชาวโลก</font></h1>
<img src = "p1.jpg" width="400" height="300"><br>
<br>เราใช้
<ol>
<li>node เวอร์ชัน <script>document.write(process.versions.node)</script></li>
<li>Chrome เวอร์ชัน <script>document.write(process.versions.chrome)</script></li>
<li>และ Electron เวอร์ชัน <script>document.write(process.versions.electron)</script></li>
</ol>
</body>
</html>
const {app, BrowserWindow} = require('electron')
const path = require('path')
const url = require('url')
let win
function createWindow () {
win = new BrowserWindow({width: 800, height: 600})
win.loadURL(
url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:', //ตัวโปโตคอล http:
slashes: true
})
)
win.on('close', () => {
win = null
})
}
app.on('ready', createWindow)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', () => {
if (win === null) {
createWindow()
}
})
This diff is collapsed.
{
"name": "windowapp",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"app": "./node_modules/electron/dist/electron .",
"อันตราย": "rm -rf *",
"touch": "touch สวัสดี",
"echo": "echo สวัสดี",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "rattanaporn",
"license": "ISC",
"devDependencies": {
"electron": "^1.8.2"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment