#gui #widgets #bindings #graphics #webview

fltk-webview

Webview for embedded fltk windows

11 releases

new 0.1.13 Aug 3, 2021
0.1.12 Jul 16, 2021
0.1.10 Jun 5, 2021
0.1.9 May 23, 2021

#245 in GUI

Download history 51/week @ 2021-05-10 82/week @ 2021-05-17 41/week @ 2021-05-24 17/week @ 2021-05-31 13/week @ 2021-06-07 5/week @ 2021-06-14 1/week @ 2021-06-21 5/week @ 2021-06-28 6/week @ 2021-07-05 20/week @ 2021-07-12 20/week @ 2021-07-19 28/week @ 2021-07-26

101 downloads per month

MIT license

140KB
322 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.1"

Then you can embed a webview using fltk_webview::Webview::create:

use fltk::{app, prelude::*, window};

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 = fltk_webview::Webview::create(false, &mut wv_win);
    wv.navigate("https://google.com");
    
    // the webview handles the main loop
    wv.run();
}

Dependencies

  • fltk-rs's dependencies, which can be found here.
  • On Linux, webkit2gtk:
    • Debian-based distros: sudo apt-get install libwebkit2gtk-4.0-dev.
    • RHEL-based distros: sudo dnf install webkit2gtk3-devel.

Limitations

  • On windows, webview requires winrt headers, that means it's basically buildable with the MSVC toolchain. For Msys2/mingw, there are efforts to provide such headers, but nothing yet upstream.
  • On macos, need help with getting mouse input to work.
  • On linux, need help with Gnome's mutter window manager fighting for ownership of the webview window!

alt_test

Dependencies

~14MB
~252K SLoC