Webview Bindings
(import (system webview))
Bindings to a modified version of the webview library.
Main Interface
procedure: (webview title url on-external-invoke option ...)
Launch a webview with the given title, URL, external invocation callback and possibly additional configuration options.
The external invocation callback receives two arguments: The webview and a string. The string argument is provided by JavaScript on the page using a call to window.external.invoke.
Both the URL and callback procedure may be #f. If no URL is passed, an empty default page is used that calls window.external.invoke("load") once when loaded. If no callback procedure is passed, window.external.invoke is available but does nothing.
The list of additional configuration options may contain the following keys:
- width to specify window width
- height to specify window height
- resizable? to specify whether the window size may be changed
- debug? to specify whether debugging tools should be enabled
procedure: (webview-terminate! webview)
Ask the given webview to quit.
procedure: (webview-title-set! webview title)
Change the title of the given webview.
procedure: (webview-fullscreen-set! webview fullscreen?)
Change the fullscreen state of the given webview.
procedure: (webview-eval webview code)
Evaluate JavaScript code in the given webview.
Dialog Interface
syntax: (dialog-type-flag symbol)
syntax: (dialog-type symbol ...)
The dialog flags enumeration is used to indicate the type of dialog presented by webview-dialog:
- open shows a file open dialog
- save shows a file save dialog
- directory allows selection of a directory instead of a file
- info shows an informational message
- warning shows a warning message
- error shows an error message
procedure: (webview-dialog webview type title value)
procedure: (webview-dialog webview type title)
Present a dialog as a modal child of the given webview. Returns the data selected in the dialog or #f.
Miscellaneous
procedure: (logf fmt arg ...)
Log a formatted message to some system-specific channel.