[v3 windows] Fix clipboard example

This commit is contained in:
Lea Anthony
2023-06-11 11:57:47 +10:00
parent b517461fbe
commit 7535f098bd
2 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -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 | | | | |
+6 -2
View File
@@ -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")