mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
[v3 Breaking Change] Add NativeWindowHandle method to WebviewWindow.
This commit is contained in:
parent
79f8d92084
commit
9a05b49e3d
2 changed files with 13 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue