mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-06 22:11:02 +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
|
package application
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
"sync"
|
"sync"
|
||||||
@ -59,6 +60,7 @@ type (
|
|||||||
getScreen() (*Screen, error)
|
getScreen() (*Screen, error)
|
||||||
setFrameless(bool)
|
setFrameless(bool)
|
||||||
openContextMenu(menu *Menu, data *ContextMenuData)
|
openContextMenu(menu *Menu, data *ContextMenuData)
|
||||||
|
nativeWindowHandle() uintptr
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -693,3 +695,10 @@ func (w *WebviewWindow) RegisterContextMenu(name string, menu *Menu) {
|
|||||||
defer w.contextMenusLock.Unlock()
|
defer w.contextMenusLock.Unlock()
|
||||||
w.contextMenus[name] = menu
|
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
|
hwnd w32.HWND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *windowsWebviewWindow) nativeWindowHandle() uintptr {
|
||||||
|
return w.hwnd
|
||||||
|
}
|
||||||
|
|
||||||
func (w *windowsWebviewWindow) setTitle(title string) {
|
func (w *windowsWebviewWindow) setTitle(title string) {
|
||||||
//TODO implement me
|
//TODO implement me
|
||||||
panic("implement me")
|
panic("implement me")
|
||||||
|
Loading…
Reference in New Issue
Block a user