Struct wry::webview::WebView [−][src]
pub struct WebView { /* fields omitted */ }
Expand description
The fundamental type to present a WebView
.
WebViewBuilder
/ WebView
are the basic building blocks to constrcut WebView contents and
scripts for those who prefer to control fine grained window creation and event handling.
WebView
presents the actuall WebView window and let you still able to perform actions
during event handling to it. WebView
also contains the associate Window
with it.
Implementations
Create a WebView
from provided Window
. Note that calling this directly loses
abilities to initialize scripts, add rpc handler, and many more before starting WebView. To
benefit from above features, create a WebViewBuilder
instead.
Platform-specific behavior:
- Unix: This method must be called in a gtk thread. Usually this means it should be
called in the same thread with the
EventLoop
you create.
Evaluate and run javascript code. Must be called on the same thread who created the
WebView
. Use EventLoopProxy
and a custom event to send scripts from other threads.
Resize the WebView manually. This is only required on Windows because its WebView API doesn’t provide a way to resize automatically.
Moves Focus to the Webview control.
It’s usually safe to call focus
method on Window
which would also focus to WebView
except Windows.
Focussing to Window
doesn’t mean focussing to WebView
on Windows. For example, if you have
an input field on webview and lost focus, you will have to explicitly click the field even you
re-focus the window. And if you focus to WebView
, it will lost focus to the Window
.
Trait Implementations
Returns WebView2 Controller