提交 410fc0db 编写于 作者: yanghye's avatar yanghye

demo: add simple for macosx

上级 2fc7a31c
提取Energy压缩包动态链接库liblcl.dll到该目录下
libs目录下的文件会被编译到执行文件中
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>cookie</title>
<style>
</style>
<script type="application/javascript">
</script>
</head>
<body style="overflow: hidden;margin: 0px;padding: 0px;">
<a href="https://www.baidu.com">百度</a>
<a href="https://energy.yanghy.cn">Energy</a>
</body>
</html>
\ No newline at end of file
可将html css javascript image等静态资源放入该目录,编译后将内置到执行程序中
通过内置http server 读取该目录文件,展示到页面中
\ No newline at end of file
package main
import (
"github.com/energye/energy/cef"
"github.com/energye/energy/common"
"github.com/energye/golcl/pkgs/macapp"
)
func main() {
//开发环境中 MacOSX平台必须在"GlobalCEFInit"之前设置CEF
macapp.MacApp.IsCEF(common.IsDarwin())
//全局初始化 每个应用都必须调用的
cef.GlobalCEFInit(nil, nil)
//创建应用
cefApp := cef.NewApplication(nil)
//指定一个URL地址,或本地html文件目录
cef.BrowserWindow.Config.DefaultUrl = "https://energy.yanghy.cn"
//运行应用
cef.Run(cefApp)
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册