<h1>Webview Bindings</h1>

<code>(import (system webview))</code>

Bindings to a modified version of the library.

<h2>Main Interface</h2>

<h3>procedure: <code>(webview <i>title</i> <i>url</i> <i>on-external-invoke</i> <i>option</i>

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 <tt>window.external.invoke</tt>.

Both the URL and callback procedure may be <tt>#f</tt>. If no URL is passed, an empty default page is used that calls <tt>window.external.invoke("load")</tt> once when loaded. If no callback procedure is passed,
 <tt>window.external.invoke</tt> is available but does nothing.

The list of additional configuration options may contain the following keys:

  *  <tt>width</tt> to specify window width
  *  <tt>height</tt> to specify window height
  *  <tt>resizable?</tt> to specify whether the window size may be changed
  *  <tt>debug?</tt> to specify whether debugging tools should be enabled

<h3>procedure: <code>(webview-terminate!

Ask the given webview to quit.

<h3>procedure: <code>(webview-title-set! <i>webview</i>

Change the title of the given webview.

<h3>procedure: <code>(webview-fullscreen-set! <i>webview</i>

Change the fullscreen state of the given webview.

<h3>procedure: <code>(webview-color-set! <i>webview</i> <i>red</i> <i>green</i> <i>blue</i>

Change the background color of the given webview.

<h3>procedure: <code>(webview-eval <i>webview</i>

Evaluate JavaScript code in the given webview.

<h2>Dialog Interface</h2>

<h3>syntax: <code>(dialog-type-flag
<h3>syntax: <code>(dialog-type <i>symbol</i>

The dialog flags enumeration is used to indicate the type of dialog presented by <tt>webview-dialog</tt>:

  *  <tt>open</tt> shows a file open dialog
  *  <tt>save</tt> shows a file save dialog
  *  <tt>directory</tt> allows selection of a directory instead of a file
  *  <tt>info</tt> shows an informational message
  *  <tt>warning</tt> shows a warning message
  *  <tt>error</tt> shows an error message

<h3>procedure: <code>(webview-dialog <i>webview</i> <i>type</i> <i>title</i>
<h3>procedure: <code>(webview-dialog <i>webview</i> <i>type</i>

Present a dialog as a modal child of the given webview. Returns the data selected in the dialog or <tt>#f</tt>.

<h2>Miscellaneous</h2>

<h3>procedure: <code>(logf <i>fmt</i> <i>arg</i>

Log a formatted message to some system-specific channel.