表示
Create and layout native views.
Process: Main
This module cannot be used until the ready
event of the app
module is emitted.
const { BaseWindow, View } = require('electron')
const win = new BaseWindow()
const view = new View()
view.setBackgroundColor('red')
view.setBounds({ x: 0, y: 0, width: 100, height: 100 })
win.contentView.addChildView(view)
Class: View
A basic native view.
Process: Main
View
is an EventEmitter.
new View()
Creates a new View
.
インスタンスイベント
Objects created with new View
emit the following events:
Event: 'bounds-changed'
Emitted when the view's bounds have changed in response to being laid out. The
new bounds can be retrieved with view.getBounds()
.
インスタンスメソッド
Objects created with new View
have the following instance methods: