diff --git a/v3/examples/binding/assets/index.html b/v3/examples/binding/assets/index.html index f77c1829..a4f53c0f 100644 --- a/v3/examples/binding/assets/index.html +++ b/v3/examples/binding/assets/index.html @@ -6,5 +6,43 @@ HELLO! + \ No newline at end of file diff --git a/v3/examples/binding/go.mod b/v3/examples/binding/go.mod index 6e43aef5..af6d1a3d 100644 --- a/v3/examples/binding/go.mod +++ b/v3/examples/binding/go.mod @@ -5,6 +5,7 @@ go 1.20 require github.com/wailsapp/wails/v3 v3.0.0-alpha.0 require ( + github.com/bep/debounce v1.2.1 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/google/uuid v1.3.0 // indirect github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e // indirect @@ -13,7 +14,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/samber/lo v1.37.0 // indirect - github.com/wailsapp/go-webview2 v1.0.1 // indirect + github.com/wailsapp/go-webview2 v1.0.2-0.20230604075323-d593c659ca7b // indirect github.com/wailsapp/mimetype v1.4.1 // indirect github.com/wailsapp/wails/v2 v2.3.2-0.20230117193915-45c3a501d9e6 // indirect golang.org/x/exp v0.0.0-20220930202632-ec3f01382ef9 // indirect diff --git a/v3/examples/binding/go.sum b/v3/examples/binding/go.sum index 56af9c50..fc2f20f3 100644 --- a/v3/examples/binding/go.sum +++ b/v3/examples/binding/go.sum @@ -1,3 +1,5 @@ +github.com/bep/debounce v1.2.1 h1:v67fRdBA9UQu2NhLFXrSg0Brw7CexQekrBwDMM8bzeY= +github.com/bep/debounce v1.2.1/go.mod h1:H8yggRPQKLUhUoqrJC1bO2xNya7vanpDl7xR3ISbCJ0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -24,8 +26,8 @@ github.com/samber/lo v1.37.0/go.mod h1:9vaz2O4o8oOnK23pd2TrXufcbdbJIa3b6cstBWKpo github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/wailsapp/go-webview2 v1.0.1 h1:dEJIeEApW/MhO2tTMISZBFZPuW7kwrFA1NtgFB1z1II= -github.com/wailsapp/go-webview2 v1.0.1/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo= +github.com/wailsapp/go-webview2 v1.0.2-0.20230604075323-d593c659ca7b h1:cztK9x+ikg6nFscy5c8NgtfIXv/d0ESdENy9+JkE8i4= +github.com/wailsapp/go-webview2 v1.0.2-0.20230604075323-d593c659ca7b/go.mod h1:Uk2BePfCRzttBBjFrBmqKGJd41P6QIHeV9kTgIeOZNo= github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhwHs= github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o= golang.org/x/exp v0.0.0-20220930202632-ec3f01382ef9 h1:RjggHMcaTVp0LOVZcW0bo8alwHrOaCrGUDgfWUHhnN4= diff --git a/v3/examples/build/README.md b/v3/examples/build/README.md index bb2b1761..adbf19d5 100644 --- a/v3/examples/build/README.md +++ b/v3/examples/build/README.md @@ -11,5 +11,5 @@ requirement. To build the example, run: ```bash -wails run -t build +wails task build ``` diff --git a/v3/examples/clipboard/main.go b/v3/examples/clipboard/main.go index c8e0e465..0986af9a 100644 --- a/v3/examples/clipboard/main.go +++ b/v3/examples/clipboard/main.go @@ -3,6 +3,7 @@ package main import ( _ "embed" "log" + "runtime" "time" "github.com/wailsapp/wails/v3/pkg/application" @@ -20,7 +21,9 @@ func main() { // Create a custom menu menu := app.NewMenu() - menu.AddRole(application.AppMenu) + if runtime.GOOS == "darwin" { + menu.AddRole(application.AppMenu) + } setClipboardMenu := menu.AddSubmenu("Set Clipboard") setClipboardMenu.Add("Set Text 'Hello'").OnClick(func(ctx *application.Context) { diff --git a/v3/examples/dialogs/README.md b/v3/examples/dialogs/README.md new file mode 100644 index 00000000..8dd15527 --- /dev/null +++ b/v3/examples/dialogs/README.md @@ -0,0 +1,25 @@ +# Dialogs Example + +This example is a comprehensive example of using dialogs in Wails. + +## Running the example + +To run the example, simply run the following command: + +```bash +go run main.go +``` + +## Building the example + +To build the example in debug mode, simply run the following command: + +```bash +wails task build +``` + +To build the example to use application icons, simply run the following command: + +```bash +wails task build:production +``` \ No newline at end of file diff --git a/v3/examples/dialogs/build/Info.dev.plist b/v3/examples/dialogs/build/Info.dev.plist new file mode 100644 index 00000000..d6d28b17 --- /dev/null +++ b/v3/examples/dialogs/build/Info.dev.plist @@ -0,0 +1,35 @@ + + + + CFBundlePackageType + APPL + CFBundleName + My App + CFBundleExecutable + app + CFBundleIdentifier + com.wails.app + CFBundleVersion + v1.0.0 + CFBundleGetInfoString + The ultimate thing + CFBundleShortVersionString + v1 + CFBundleIconFile + icons + LSMinimumSystemVersion + 10.13.0 + NSHighResolutionCapable + true + NSHumanReadableCopyright + (c) Me + NSAppTransportSecurity + + NSAllowsLocalNetworking + + + + + + + \ No newline at end of file diff --git a/v3/examples/build/buildtest.app/Contents/Info.plist b/v3/examples/dialogs/build/Info.plist similarity index 100% rename from v3/examples/build/buildtest.app/Contents/Info.plist rename to v3/examples/dialogs/build/Info.plist diff --git a/v3/examples/dialogs/build/appicon.png b/v3/examples/dialogs/build/appicon.png new file mode 100644 index 00000000..63617fe4 Binary files /dev/null and b/v3/examples/dialogs/build/appicon.png differ diff --git a/v3/examples/build/build/icons.ico b/v3/examples/dialogs/build/icon.ico similarity index 100% rename from v3/examples/build/build/icons.ico rename to v3/examples/dialogs/build/icon.ico diff --git a/v3/examples/build/buildtest.app/Contents/Resources/icons.icns b/v3/examples/dialogs/build/icons.icns similarity index 100% rename from v3/examples/build/buildtest.app/Contents/Resources/icons.icns rename to v3/examples/dialogs/build/icons.icns diff --git a/v3/examples/dialogs/build/info.json b/v3/examples/dialogs/build/info.json new file mode 100644 index 00000000..1005eb5c --- /dev/null +++ b/v3/examples/dialogs/build/info.json @@ -0,0 +1,15 @@ +{ + "fixed": { + "file_version": "v1.0.0" + }, + "info": { + "0000": { + "ProductVersion": "v1.0.0", + "CompanyName": "My Company Name", + "FileDescription": "A thing that does a thing", + "LegalCopyright": "(c) 2023 My Company Name", + "ProductName": "My Product Name", + "Comments": "This is a comment" + } + } +} \ No newline at end of file diff --git a/v3/examples/dialogs/build/wails.exe.manifest b/v3/examples/dialogs/build/wails.exe.manifest new file mode 100644 index 00000000..fb1ce5bd --- /dev/null +++ b/v3/examples/dialogs/build/wails.exe.manifest @@ -0,0 +1,15 @@ + + + + + + + + + + + true/pm + permonitorv2,permonitor + + + \ No newline at end of file diff --git a/v3/examples/dialogs/main.go b/v3/examples/dialogs/main.go index 2301fd98..56e4f131 100644 --- a/v3/examples/dialogs/main.go +++ b/v3/examples/dialogs/main.go @@ -50,6 +50,9 @@ func main() { dialog.SetIcon(icons.ApplicationDarkMode256) dialog.Show() }) + infoMenu.Add("About").OnClick(func(ctx *application.Context) { + app.ShowAboutDialog() + }) questionMenu := menu.AddSubmenu("Question") questionMenu.Add("Question (No default)").OnClick(func(ctx *application.Context) {