File tree Expand file tree Collapse file tree 4 files changed +8
-7
lines changed
Expand file tree Collapse file tree 4 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ This example integrates the [`v-js-interop-app`](https://github.com/ttytm/webvie
44into a project structure that can be used as a starting guide for more complex Webview projects.
55
66```
7+ ├── assets/
8+ │ └── icon.ico
79├── src/
810│ ├── api.v
911│ ├── main.v
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ const doc = '<!DOCTYPE html>
1717 function myJsFunction(myArg) {
1818 console.log("Called myJsFunction:", myArg);
1919 };
20- // Calls a V function that in turn calls the above JS function
20+ // Calls a V function that in turn calls the above JS function.
2121 window.interop();
2222
23- // Calls a V function that returns a Value
23+ // Calls a V function that returns a Value.
2424 (async () => {
2525 num = await window.double(2);
2626 console.log(num);
@@ -36,7 +36,7 @@ fn interop(e &webview.Event) voidptr {
3636 return webview.no_result
3737}
3838
39- // Returns a value to JS
39+ // Returns a value to JS.
4040fn double (e & webview.Event) int {
4141 return e.int (0 ) * 2
4242}
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ pub const no_result = unsafe { nil }
6060// Depending on the platform, a GtkWindow, NSWindow or HWND pointer can be passed here.
6161// Returns null on failure. Creation can fail for various reasons such as when required runtime
6262// dependencies are missing or when window creation fails.
63-
6463pub fn create (opts CreateOptions) & Webview {
6564 return C.webview_create (int (opts.debug), opts.window)
6665}
@@ -105,8 +104,8 @@ pub fn (w &Webview) get_window() voidptr {
105104 return C.webview_get_window (w)
106105}
107106
108- // set_icon updates the icon for the native window. It supports Windows HWND and Linux GTK windows
109- // under X11 - Under Wayland, window application mapping is based on the desktop file entry name.
107+ // set_icon updates the icon of the native window. It supports Windows HWND windows and Linux GTK
108+ // windows under X11 - under Wayland, window application mapping is based on the desktop file entry name.
110109// TODO: add macOS support
111110pub fn (w &Webview) set_icon (icon_file_path string ) ! {
112111 $if windows {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ fn gen_html(test_name string, script string) string {
1515}
1616
1717fn test_timeout () {
18- // We check if the V functions are called and windows closed successfully within 30 seconds.
18+ // We check if the V functions are called and windows closed successfully within 60 seconds.
1919 // Otherwise, windows can remain open and the test can run indefinitely.
2020 spawn fn () {
2121 time.sleep (60 * time.second)
You can’t perform that action at this time.
0 commit comments