-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7941f00
commit 212f5c7
Showing
14 changed files
with
160 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package main | ||
|
||
import ( | ||
_ "embed" | ||
"github.com/wailsapp/wails/v3/pkg/application" | ||
"log" | ||
) | ||
|
||
func main() { | ||
app := application.New(application.Options{ | ||
Name: "Key Bindings Demo", | ||
Description: "A demo of the Key Bindings Options", | ||
Mac: application.MacOptions{ | ||
ApplicationShouldTerminateAfterLastWindowClosed: true, | ||
}, | ||
KeyBindings: map[string]func(window *application.WebviewWindow){ | ||
"shift+ctrl+c": func(window *application.WebviewWindow) { | ||
selection, err := application.OpenFileDialog(). | ||
CanChooseFiles(true). | ||
CanCreateDirectories(true). | ||
ShowHiddenFiles(true). | ||
PromptForMultipleSelection() | ||
if err != nil { | ||
println(err.Error()) | ||
} | ||
println(selection) | ||
}, | ||
}, | ||
}) | ||
|
||
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ | ||
Name: "Window 1", | ||
Title: "Window 1", | ||
URL: "https://wails.io", | ||
KeyBindings: map[string]func(window *application.WebviewWindow){ | ||
"F12": func(window *application.WebviewWindow) { | ||
window.OpenDevTools() | ||
}, | ||
}, | ||
}) | ||
|
||
app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{ | ||
Name: "Window 2", | ||
Title: "Window 2", | ||
URL: "https://google.com", | ||
KeyBindings: map[string]func(window *application.WebviewWindow){ | ||
"F12": func(window *application.WebviewWindow) { | ||
println("Window 2: Toggle Dev Tools") | ||
}, | ||
}, | ||
}) | ||
|
||
err := app.Run() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters