mirror of
https://gitee.com/energye/energy.git
synced 2024-11-30 18:57:39 +08:00
demos debug日志输出
This commit is contained in:
parent
6d8791c17a
commit
0c9943f371
@ -10,6 +10,9 @@ import (
|
||||
|
||||
// LCL组件托盘, 适用windows和macosx, 不支持linux因GTK2和GTK3共存问题,
|
||||
func LCLTrayDemo(browserWindow cef.IBrowserWindow) {
|
||||
if !browserWindow.IsLCL() {
|
||||
return
|
||||
}
|
||||
window := browserWindow.AsLCLBrowserWindow().BrowserWindow()
|
||||
//托盘 windows linux macos 系统托盘
|
||||
newTray := window.NewTray()
|
||||
@ -49,9 +52,9 @@ func LCLTrayDemo(browserWindow cef.IBrowserWindow) {
|
||||
tray.Show()
|
||||
}
|
||||
|
||||
//系统托盘 和LCL组件差不多,但不如LCL组件的好用,适用 windows,linux,macosx
|
||||
// 系统托盘 和LCL组件差不多,但不如LCL组件的好用,适用 windows,linux,macosx
|
||||
//
|
||||
//推荐linux中使用
|
||||
// 推荐linux中使用
|
||||
func SysTrayDemo(browserWindow cef.IBrowserWindow) {
|
||||
sysTray := browserWindow.NewSysTray()
|
||||
if common.IsLinux() {
|
||||
|
@ -15,6 +15,7 @@ import (
|
||||
"github.com/energye/energy/common"
|
||||
"github.com/energye/energy/common/assetserve"
|
||||
"github.com/energye/energy/example/dev-test/traydemo"
|
||||
"github.com/energye/energy/logger"
|
||||
"github.com/energye/golcl/lcl"
|
||||
)
|
||||
|
||||
@ -22,6 +23,8 @@ import (
|
||||
var resources embed.FS
|
||||
|
||||
func main() {
|
||||
logger.SetEnable(true)
|
||||
logger.SetLevel(logger.CefLog_Debug)
|
||||
//全局初始化 每个应用都必须调用的
|
||||
cef.GlobalInit(nil, &resources)
|
||||
//创建应用
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"github.com/energye/energy/common/assetserve"
|
||||
"github.com/energye/energy/example/sub-process/main-process/src"
|
||||
"github.com/energye/energy/example/sub-process/vars"
|
||||
"github.com/energye/energy/logger"
|
||||
"github.com/energye/golcl/pkgs/macapp"
|
||||
"os"
|
||||
"path"
|
||||
@ -28,6 +29,8 @@ var resources embed.FS
|
||||
3. 运行主程序
|
||||
*/
|
||||
func main() {
|
||||
logger.SetEnable(true)
|
||||
logger.SetLevel(logger.CefLog_Debug)
|
||||
//MacOS通过指定 IsCEF ,在开发环境中自动生成可运行的程序包
|
||||
//MacOS配置要在 GlobalInit 它之前
|
||||
//特别说明MacOS:子进程不需要配置
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"github.com/energye/energy/cef"
|
||||
"github.com/energye/energy/example/sub-process/vars"
|
||||
"github.com/energye/energy/ipc"
|
||||
"github.com/energye/energy/logger"
|
||||
)
|
||||
|
||||
/*
|
||||
@ -13,6 +14,8 @@ import (
|
||||
子进程需要先编译好,提供给主进程(SetBrowseSubprocessPath)配置
|
||||
*/
|
||||
func main() {
|
||||
logger.SetEnable(true)
|
||||
logger.SetLevel(logger.CefLog_Debug)
|
||||
//全局配置初始化
|
||||
cef.GlobalInit(nil, nil)
|
||||
//创建Cef应用
|
||||
@ -26,7 +29,7 @@ func main() {
|
||||
cefApp.Free()
|
||||
}
|
||||
|
||||
//渲染进程 IPC事件
|
||||
// 渲染进程 IPC事件
|
||||
func IPCInit(event ipc.IEventOn) {
|
||||
fmt.Println("渲染进程IPC事件注册")
|
||||
//渲染进程监听的事件
|
||||
|
Loading…
Reference in New Issue
Block a user