mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[v3 windows] Fix clipboard example
This commit is contained in:
+2
-2
@@ -348,7 +348,7 @@ TODO:
|
||||
|--------------|--------------------|-------|-----|-------------------------|
|
||||
| binding | NO | | | |
|
||||
| build | Yes (Debug + Prod) | | | |
|
||||
| clipboard | NO | | | |
|
||||
| clipboard | Yes | | | |
|
||||
| contextmenus | Yes | | | |
|
||||
| dialogs | Almost | | | |
|
||||
| drag-n-drop | NO | | | |
|
||||
@@ -359,7 +359,7 @@ TODO:
|
||||
| plain | Yes | | | |
|
||||
| plugins | | | | Just needs StartAtLogin |
|
||||
| screen | Yes | | | |
|
||||
| systray | | | | |
|
||||
| systray | Yes | | | |
|
||||
| window | | | | |
|
||||
| windowjs | | | | |
|
||||
| wml | | | | |
|
||||
|
||||
@@ -46,8 +46,12 @@ func main() {
|
||||
})
|
||||
getClipboardMenu := menu.AddSubmenu("Get Clipboard")
|
||||
getClipboardMenu.Add("Get Text").OnClick(func(ctx *application.Context) {
|
||||
result := app.Clipboard().Text()
|
||||
app.InfoDialog().SetMessage("Got:\n\n" + result).Show()
|
||||
result, ok := app.Clipboard().Text()
|
||||
if !ok {
|
||||
app.InfoDialog().SetMessage("Failed to get clipboard text").Show()
|
||||
} else {
|
||||
app.InfoDialog().SetMessage("Got:\n\n" + result).Show()
|
||||
}
|
||||
})
|
||||
|
||||
clearClipboardMenu := menu.AddSubmenu("Clear Clipboard")
|
||||
|
||||
Reference in New Issue
Block a user