energy/example/browser-control/control.go
2023-02-28 18:41:12 +08:00

29 lines
648 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package main
import (
"embed"
"github.com/energye/energy/cef"
"github.com/energye/energy/example/browser-control/src"
)
//go:embed resources
var resources embed.FS
//go:embed libs
var libs embed.FS
func main() {
//开发环境中 MacOSX平台必须在"GlobalInit"之前设置CEF
//设置使用CEF 和 CEF框架目录生成开发执行应用程序包
//环境变量 ENERGY_HOME="/app/cefframework" 配置框架所在目录
//全局初始化 每个应用都必须调用的
cef.GlobalInit(&libs, &resources)
//创建应用
cefApp := cef.NewApplication()
//主进程窗口
src.MainBrowserWindow()
//运行应用
cef.Run(cefApp)
}