39 releases
| 0.4.7 | Nov 4, 2025 |
|---|---|
| 0.4.5 | Oct 30, 2025 |
| 0.4.3 | Nov 6, 2024 |
| 0.4.2 | Feb 5, 2024 |
| 0.1.12 | Jul 16, 2021 |
#1429 in GUI
195KB
375 lines
fltk-webview
This provides webview functionality for embedded fltk windows.
Usage
Add fltk-webview to your fltk application's Cargo.toml file:
[dependencies]
fltk = "1"
fltk-webview = "0.4"
Then you can embed a webview using fltk_webview::Webview::create:
use fltk::{app, prelude::*, window};
use fltk_webview::*;
fn main() {
let app = app::App::default();
let mut win = window::Window::default()
.with_size(800, 600)
.with_label("Webview");
let mut wv_win = window::Window::default()
.with_size(790, 590)
.center_of_parent();
win.end();
win.make_resizable(true);
win.show();
let mut wv = Webview::create(false, &mut wv_win);
wv.navigate("https://google.com");
app.run().unwrap();
}
Dependencies
- fltk-rs's dependencies, which can be found here.
- On Windows: No other dependencies.
- On macOS: No other dependencies.
- On Linux (X11 only): WebKitGTK and X11 dev packages.
- Debian-based distros:
sudo apt-get install libwebkit2gtk-4.1-dev libx11-dev. - RHEL-based distros:
sudo dnf install webkit2gtk3-devel libX11-devel.
- Debian-based distros:
Linux Notes
- This crate supports X11 only on Linux. On GNOME or Wayland sessions, force X11:
GDK_BACKEND=x11. - GNOME/Mutter can interfere with embedded toplevels; the X11 path mitigates this by making the webview unmanaged.
- If you see blanking, try:
WEBKIT_DISABLE_COMPOSITING_MODE=1.


Dependencies
~46MB
~315K SLoC