U: demo scheme

This commit is contained in:
yanghy 2023-07-25 09:43:42 +08:00
parent 7604d7f987
commit 613c1bb9e9

View File

@ -40,7 +40,7 @@ func main() {
var idClear consts.MenuId
var idURL consts.MenuId
// 在右键菜单实现这个示例
event.SetOnBeforeContextMenu(func(sender lcl.IObject, browser *cef.ICefBrowser, frame *cef.ICefFrame, params *cef.ICefContextMenuParams, model *cef.ICefMenuModel) {
event.SetOnBeforeContextMenu(func(sender lcl.IObject, browser *cef.ICefBrowser, frame *cef.ICefFrame, params *cef.ICefContextMenuParams, model *cef.ICefMenuModel) bool {
model.AddSeparator()
idScheme = model.CefMis.NextCommandId()
model.AddItem(idScheme, "RegScheme")
@ -48,6 +48,7 @@ func main() {
model.AddItem(idClear, "ClearScheme")
idURL = model.CefMis.NextCommandId()
model.AddItem(idURL, "URL")
return true
})
// 右键菜单命令
event.SetOnContextMenuCommand(func(sender lcl.IObject, browser *cef.ICefBrowser, frame *cef.ICefFrame, params *cef.ICefContextMenuParams, commandId consts.MenuId, eventFlags uint32, result *bool) {