Skip to content

Commit

Permalink
A first BrowserWindow (with contents)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrieseberg committed Aug 31, 2017
1 parent 366a1e3 commit bb57080
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,17 @@ let mainWindow

app.on('ready', () => {
console.log('Application ready!')
mainWindow = new BrowserWindow()

mainWindow = new BrowserWindow({
show: false,
width: 1000,
height: 800
})

mainWindow.webContents.on('dom-ready', () => {
// The window has loaded its contents
mainWindow.show()
})

mainWindow.loadURL(`file://${__dirname}/../renderer/index.html`)
})
12 changes: 12 additions & 0 deletions src/renderer/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>My Code Editor</title>
<link href="style.css" rel="stylesheet">
</head>
<body>
<div id="container">
Hello!
</div>
</body>
</html>
9 changes: 9 additions & 0 deletions src/renderer/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
html, body {
margin: 0;
overflow: hidden;
}

div#container {
height: 100vh;
width: 100vw;
}

0 comments on commit bb57080

Please sign in to comment.