Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
energye
energy
提交
d540b82c
energy
项目概览
energye
/
energy
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
energy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d540b82c
编写于
7月 20, 2023
作者:
yanghye
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
U: demos, ui use gtk3, IconFS = xxx.png, other IconFS = xxx.ico
上级
bfe5a85f
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
60 addition
and
60 deletion
+60
-60
example/context-menu/context-menu.go
example/context-menu/context-menu.go
+1
-1
example/control/control.go
example/control/control.go
+4
-4
example/control/src/main-browser-window.go
example/control/src/main-browser-window.go
+27
-27
example/cookie-manager/cookie-manager.go
example/cookie-manager/cookie-manager.go
+1
-1
example/cookie/cookie.go
example/cookie/cookie.go
+1
-1
example/custom-drag-window/custom-drag-window.go
example/custom-drag-window/custom-drag-window.go
+1
-1
example/dom-visitor/dom-visitor.go
example/dom-visitor/dom-visitor.go
+1
-1
example/download/download.go
example/download/download.go
+1
-1
example/drag-file/drag-file.go
example/drag-file/drag-file.go
+1
-1
example/execute-dev-tools-method/dev-tools-method.go
example/execute-dev-tools-method/dev-tools-method.go
+1
-1
example/execute-javascript/execute-javascript.go
example/execute-javascript/execute-javascript.go
+1
-1
example/frameless/frameless.go
example/frameless/frameless.go
+1
-1
example/i18n/i18n.go
example/i18n/i18n.go
+1
-1
example/internal-http-server/internal-http-server.go
example/internal-http-server/internal-http-server.go
+1
-1
example/ipc-on-emit/go-composite-type/go-composite-type.go
example/ipc-on-emit/go-composite-type/go-composite-type.go
+1
-1
example/ipc-on-emit/go-to-js/go-to-js.go
example/ipc-on-emit/go-to-js/go-to-js.go
+1
-1
example/ipc-on-emit/js-to-go/js-to-go.go
example/ipc-on-emit/js-to-go/js-to-go.go
+1
-1
example/key-event/key-event.go
example/key-event/key-event.go
+1
-1
example/load-html-url/load-html-url.go
example/load-html-url/load-html-url.go
+1
-1
example/msgbox/msgbox.go
example/msgbox/msgbox.go
+1
-1
example/popup-sub-window/popup-sub-window.go
example/popup-sub-window/popup-sub-window.go
+1
-1
example/print-pdf/print-pdf.go
example/print-pdf/print-pdf.go
+1
-1
example/process-type/process-type.go
example/process-type/process-type.go
+1
-1
example/response-filter/response-filter.go
example/response-filter/response-filter.go
+1
-1
example/scheme/scheme.go
example/scheme/scheme.go
+1
-1
example/search-text/seach-text.go
example/search-text/seach-text.go
+1
-1
example/sub-process/main-process/main-process.go
example/sub-process/main-process/main-process.go
+1
-1
example/sub-process/main-process/src/main-browser.go
example/sub-process/main-process/src/main-browser.go
+2
-2
example/sys-dialog/sysdialog.go
example/sys-dialog/sysdialog.go
+1
-1
example/webkit-register/webkit-register.go
example/webkit-register/webkit-register.go
+1
-1
未找到文件。
example/context-menu/context-menu.go
浏览文件 @
d540b82c
...
...
@@ -21,7 +21,7 @@ func main() {
cefApp
:=
cef
.
NewApplication
()
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/index.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/control/control.go
浏览文件 @
d540b82c
...
...
@@ -19,11 +19,11 @@ func main() {
//全局初始化 每个应用都必须调用的
cef
.
GlobalInit
(
&
libs
,
&
resources
)
//创建应用
cefA
pp
:=
cef
.
NewApplication
()
cefA
pp
.
SetEnableGPU
(
true
)
a
pp
:=
cef
.
NewApplication
()
a
pp
.
SetEnableGPU
(
true
)
//主进程窗口
src
.
MainBrowserWindow
()
src
.
MainBrowserWindow
(
app
)
//运行应用
cef
.
Run
(
cefA
pp
)
cef
.
Run
(
a
pp
)
}
example/control/src/main-browser-window.go
浏览文件 @
d540b82c
...
...
@@ -10,7 +10,7 @@ import (
)
//主浏览器窗口
func
MainBrowserWindow
()
{
func
MainBrowserWindow
(
app
*
cef
.
TCEFApplication
)
{
//只有启动主进程才会继续执行
if
!
process
.
Args
.
IsMain
()
{
return
...
...
@@ -23,7 +23,7 @@ func MainBrowserWindow() {
//窗口宽高
cef
.
BrowserWindow
.
Config
.
Width
=
1024
cef
.
BrowserWindow
.
Config
.
Height
=
768
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
@@ -35,34 +35,34 @@ func MainBrowserWindow() {
cef
.
BrowserWindow
.
Config
.
SetChromiumConfig
(
config
)
//创建窗口时的回调函数 对浏览器事件设置,和窗口属性组件等创建和修改
cef
.
BrowserWindow
.
SetBrowserInit
(
func
(
event
*
cef
.
BrowserEvent
,
window
cef
.
IBrowserWindow
)
{
if
window
.
IsLCL
()
{
//在窗体初始化时创建窗口内的组件
back
,
forward
,
stop
,
refresh
,
progressLabel
,
addr
:=
controlUI
(
window
.
AsLCLBrowserWindow
()
.
BrowserWindow
())
//页面加载处理进度
event
.
SetOnLoadingProgressChange
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
progress
float64
)
{
//linux 更新UI组件必须使用 QueueAsyncCall 主线程异步同步
cef
.
QueueAsyncCall
(
func
(
id
int
)
{
//参数-进度
progressLabel
.
SetCaption
(
fmt
.
Sprintf
(
"%v"
,
progress
*
100
))
})
//if window.IsLCL() {
//在窗体初始化时创建窗口内的组件
back
,
forward
,
stop
,
refresh
,
progressLabel
,
addr
:=
controlUI
(
window
.
AsLCLBrowserWindow
()
.
BrowserWindow
())
//页面加载处理进度
event
.
SetOnLoadingProgressChange
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
progress
float64
)
{
//linux 更新UI组件必须使用 QueueAsyncCall 主线程异步同步
cef
.
QueueAsyncCall
(
func
(
id
int
)
{
//参数-进度
progressLabel
.
SetCaption
(
fmt
.
Sprintf
(
"%v"
,
progress
*
100
))
})
//页面加载状态,根据状态判断是否加载完成,和是否可前进后退
event
.
SetOnLoadingStateChange
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
isLoading
,
canGoBack
,
canGoForward
bool
)
{
//linux 更新UI组件必须使用 QueueAsyncCall 主线程异步同步
cef
.
QueueAsyncCall
(
func
(
id
int
)
{
//控制按钮状态
stop
.
SetEnabled
(
isLoading
)
refresh
.
SetEnabled
(
!
isLoading
)
back
.
SetEnabled
(
canGoBack
)
forward
.
SetEnabled
(
canGoForward
)
}
)
})
//页面加载状态,根据状态判断是否加载完成,和是否可前进后退
event
.
SetOnLoadingStateChange
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
isLoading
,
canGoBack
,
canGoForward
bool
)
{
//linux 更新UI组件必须使用 QueueAsyncCall 主线程异步同步
cef
.
QueueAsyncCall
(
func
(
id
int
)
{
//控制按钮状态
stop
.
SetEnabled
(
isLoading
)
refresh
.
SetEnabled
(
!
isLoading
)
back
.
SetEnabled
(
canGoBack
)
forward
.
SetEnabled
(
canGoForward
)
})
event
.
SetOnAddressChange
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
frame
*
cef
.
ICefFrame
,
url
string
)
{
cef
.
QueueAsyncCall
(
func
(
id
int
)
{
addr
.
SetText
(
url
)
}
)
})
event
.
SetOnAddressChange
(
func
(
sender
lcl
.
IObject
,
browser
*
cef
.
ICefBrowser
,
frame
*
cef
.
ICefFrame
,
url
string
)
{
cef
.
QueueAsyncCall
(
func
(
id
int
)
{
addr
.
SetText
(
url
)
})
}
})
//}
})
}
...
...
example/cookie-manager/cookie-manager.go
浏览文件 @
d540b82c
...
...
@@ -22,7 +22,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"https://www.baidu.com"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - cookie-manager"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/cookie/cookie.go
浏览文件 @
d540b82c
...
...
@@ -27,7 +27,7 @@ func main() {
//主窗口的配置
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/cookie.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/custom-drag-window/custom-drag-window.go
浏览文件 @
d540b82c
...
...
@@ -15,7 +15,7 @@ func main() {
cef
.
GlobalInit
(
nil
,
&
resources
)
app
:=
cef
.
NewApplication
()
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/index.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/dom-visitor/dom-visitor.go
浏览文件 @
d540b82c
...
...
@@ -25,7 +25,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/dom-visitor.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - dom-visitor"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/download/download.go
浏览文件 @
d540b82c
...
...
@@ -25,7 +25,7 @@ func main() {
//主窗口的配置
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/download.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/drag-file/drag-file.go
浏览文件 @
d540b82c
...
...
@@ -17,7 +17,7 @@ func main() {
cef
.
GlobalInit
(
nil
,
&
resources
)
app
:=
cef
.
NewApplication
()
cef
.
BrowserWindow
.
Config
.
Url
=
"http://chrome.360.cn/html5_labs/demos/dnd/"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/execute-dev-tools-method/dev-tools-method.go
浏览文件 @
d540b82c
...
...
@@ -24,7 +24,7 @@ func main() {
//主窗口的配置
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/execute-dev-tool-method.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/execute-javascript/execute-javascript.go
浏览文件 @
d540b82c
...
...
@@ -21,7 +21,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/execute-javascript.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - execute-javascript"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/frameless/frameless.go
浏览文件 @
d540b82c
...
...
@@ -35,7 +35,7 @@ func main() {
//cefApp.SetMultiThreadedMessageLoop(false)
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/index.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/i18n/i18n.go
浏览文件 @
d540b82c
...
...
@@ -35,7 +35,7 @@ func main() {
i18n
.
Switch
(
consts
.
LANGUAGE_zh_CN
)
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/i18n.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/internal-http-server/internal-http-server.go
浏览文件 @
d540b82c
...
...
@@ -20,7 +20,7 @@ func main() {
cefApp
:=
cef
.
NewApplication
()
//主窗口的配置
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - 内置资源和内置服务示例"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/ipc-on-emit/go-composite-type/go-composite-type.go
浏览文件 @
d540b82c
...
...
@@ -22,7 +22,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/go-composite-type.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - go-composite-type"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/ipc-on-emit/go-to-js/go-to-js.go
浏览文件 @
d540b82c
...
...
@@ -23,7 +23,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/go-to-js.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - go on event - js emit event"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/ipc-on-emit/js-to-go/js-to-go.go
浏览文件 @
d540b82c
...
...
@@ -21,7 +21,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/js-to-go.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - js on event - go emit event"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/key-event/key-event.go
浏览文件 @
d540b82c
...
...
@@ -21,7 +21,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/key-event.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - Key Event"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/load-html-url/load-html-url.go
浏览文件 @
d540b82c
...
...
@@ -22,7 +22,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
indexHtmlPath
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy 本地加载html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/msgbox/msgbox.go
浏览文件 @
d540b82c
...
...
@@ -24,7 +24,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/msgbox.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - msgbox"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/popup-sub-window/popup-sub-window.go
浏览文件 @
d540b82c
...
...
@@ -26,7 +26,7 @@ func main() {
cefApp
:=
cef
.
NewApplication
()
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/index.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/print-pdf/print-pdf.go
浏览文件 @
d540b82c
...
...
@@ -23,7 +23,7 @@ func main() {
cefApp
:=
cef
.
NewApplication
()
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/index.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/process-type/process-type.go
浏览文件 @
d540b82c
...
...
@@ -28,7 +28,7 @@ func main() {
cefApp
:=
cef
.
NewApplication
()
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"https://energy.yanghy.cn"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/response-filter/response-filter.go
浏览文件 @
d540b82c
...
...
@@ -28,7 +28,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/response-filter.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - response-filter"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/scheme/scheme.go
浏览文件 @
d540b82c
...
...
@@ -26,7 +26,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"https://www.baidu.com/"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - Scheme"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/search-text/seach-text.go
浏览文件 @
d540b82c
...
...
@@ -22,7 +22,7 @@ func main() {
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/index.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy 搜索页面中文本"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/sub-process/main-process/main-process.go
浏览文件 @
d540b82c
...
...
@@ -61,7 +61,7 @@ func main() {
//cefApp.SetSingleProcess(false) //单进程 或 多进程 ,单进程上面的子进程配置就不起作用了
cefApp
.
SetBrowserSubprocessPath
(
subExePath
)
//主进程初始化
src
.
MainBrowserInit
()
src
.
MainBrowserInit
(
cefApp
)
cef
.
SetBrowserProcessStartAfterCallback
(
func
(
b
bool
)
{
fmt
.
Println
(
"主进程启动 创建一个内置http服务"
)
//通过内置http服务加载资源
...
...
example/sub-process/main-process/src/main-browser.go
浏览文件 @
d540b82c
...
...
@@ -8,11 +8,11 @@ import (
)
//主进程浏览器初始化
func
MainBrowserInit
()
{
func
MainBrowserInit
(
app
*
cef
.
TCEFApplication
)
{
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/index.html"
cef
.
BrowserWindow
.
Config
.
Title
=
"ENERGY 区分主/子进程执行文件"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/sys-dialog/sysdialog.go
浏览文件 @
d540b82c
...
...
@@ -38,7 +38,7 @@ func main() {
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/sysdialog.html"
}
cef
.
BrowserWindow
.
Config
.
Title
=
"Energy - dialog"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
app
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
example/webkit-register/webkit-register.go
浏览文件 @
d540b82c
...
...
@@ -28,7 +28,7 @@ func main() {
cefApp
:=
cef
.
NewApplication
()
//指定一个URL地址,或本地html文件目录
cef
.
BrowserWindow
.
Config
.
Url
=
"http://localhost:22022/webkit-register.html"
if
common
.
IsLinux
()
{
if
common
.
IsLinux
()
&&
cefApp
.
IsUIGtk3
()
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.png"
}
else
{
cef
.
BrowserWindow
.
Config
.
IconFS
=
"resources/icon.ico"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录