Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #1065

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,30 @@ Cross-platform WebView rendering library in Rust that supports all major desktop

## Overview

WRY connects the web engine on each platform and provides easy to use and unified interface to render WebView. It also re-exports [TAO] as a module for event loop and window creation.

[tao]: https://crates.io/crates/tao
WRY connects the web engine on each platform and provides easy to use and unified interface to render WebView.
The webview requires a running event loop and a window type that implements `HasWindowHandle`,
or a gtk container widget if you need to support X11 and Wayland.
You can use a windowing library like `tao` or `winit`.

## Usage

The minimum example to create a Window and browse a website looks like following:

```rust
fn main() -> wry::Result<()> {
use wry::{
application::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
},
webview::WebViewBuilder,
fn main() {
use tao::{
event::{Event, StartCause, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
use wry::webview::WebViewBuilder;

let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.with_title("Hello World")
.build(&event_loop)?;
let _webview = WebViewBuilder::new(window)?
.with_url("https://tauri.studio")?
let _webview = WebViewBuilder::new(&window)?
.with_url("https://tauri.app")?
.build()?;

event_loop.run(move |event, _, control_flow| {
Expand All @@ -62,7 +61,7 @@ fn main() -> wry::Result<()> {
There are also more samples under `examples`, you can enter commands like the following to try them:

```
cargo run --example multi_window
cargo run --example multiwindow
```

For more information, please read the documentation below.
Expand All @@ -71,11 +70,11 @@ For more information, please read the documentation below.

## Platform-specific notes

All platforms use [TAO](https://github.com/tauri-apps/tao) to build the window, and wry re-exports it as an application module. Here is the underlying web engine each platform uses, and some dependencies you might need to install.
Here is the underlying web engine each platform uses, and some dependencies you might need to install.

### Linux

Tao uses [gtk-rs](https://gtk-rs.org/) and its related libraries for window creation and wry also needs [WebKitGTK](https://webkitgtk.org/) for WebView. So please make sure the following packages are installed:
Wry also needs [WebKitGTK](https://webkitgtk.org/) for WebView. So please make sure the following packages are installed:

#### Arch Linux / Manjaro:

Expand Down
Loading