diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-05-18 17:43:12 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-05-18 18:05:35 +0200 |
commit | c1b8a4ee05ead72fa1db40a3c22faa2acf249a81 (patch) | |
tree | 5a96142f9c7127e28c3534e66e4fdde27c5fb356 /src/gui.rs | |
parent | f5688f1ae36a646134a21b138c48a1f508c611ce (diff) |
Fix spawning
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/gui.rs')
-rw-r--r-- | src/gui.rs | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -1,5 +1,9 @@ +use std::fmt::Debug; + use anyhow::Error; use anyhow::Result; +use web_view::WVResult; +use web_view::WebView; use crate::app::App; use crate::cli::*; @@ -27,7 +31,7 @@ pub fn run_gui(config: Configuration, adr: String) -> Result<()> { } }; - let webview_content = web_view::Content::Url(adr.clone()); + let webview_content = web_view::Content::Url(format!("http://{}", adr)); web_view::builder() .title("My Project") @@ -35,10 +39,15 @@ pub fn run_gui(config: Configuration, adr: String) -> Result<()> { .resizable(true) .debug(true) .user_data(()) - .invoke_handler(|_webview, _arg| Ok(())) + .invoke_handler(invoke_handler) .build() .map_err(Error::from)? .run() .map_err(Error::from) } +fn invoke_handler<T: Debug>(webview: &mut WebView<T>, s: &str) -> WVResult { + debug!("invoke-handler: {:?}, {:?}", webview, s); + Ok(()) +} + |