mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-06 22:29:31 +08:00
[v3 Breaking Change] Add NativeWindowHandle
method to WebviewWindow
.
This commit is contained in:
parent
728e2019d8
commit
17204bebd0
@ -1,6 +1,7 @@
|
||||
package application
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/samber/lo"
|
||||
"sync"
|
||||
@ -59,6 +60,7 @@ type (
|
||||
getScreen() (*Screen, error)
|
||||
setFrameless(bool)
|
||||
openContextMenu(menu *Menu, data *ContextMenuData)
|
||||
nativeWindowHandle() uintptr
|
||||
}
|
||||
)
|
||||
|
||||
@ -693,3 +695,10 @@ func (w *WebviewWindow) RegisterContextMenu(name string, menu *Menu) {
|
||||
defer w.contextMenusLock.Unlock()
|
||||
w.contextMenus[name] = menu
|
||||
}
|
||||
|
||||
func (w *WebviewWindow) NativeWindowHandle() (uintptr, error) {
|
||||
if w.impl == nil {
|
||||
return 0, errors.New("native handle unavailable as window is not running")
|
||||
}
|
||||
return w.impl.nativeWindowHandle(), nil
|
||||
}
|
||||
|
@ -21,6 +21,10 @@ type windowsWebviewWindow struct {
|
||||
hwnd w32.HWND
|
||||
}
|
||||
|
||||
func (w *windowsWebviewWindow) nativeWindowHandle() uintptr {
|
||||
return w.hwnd
|
||||
}
|
||||
|
||||
func (w *windowsWebviewWindow) setTitle(title string) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
|
Loading…
Reference in New Issue
Block a user