tauri/examples/run-iteration/main.rs
Lucas Fernandes Nogueira ec9818accb
refactor(core)!: App::run_iteration improvements (#8696)
* refactor(core): App::run_iteration improvements

* lint

* fixes

* fix exit

* Apply suggestions from code review

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>

* update cargo.toml

* booooool

* fix mock runtime

* fix doctests

* fix doctest againrrrr

---------

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
2024-01-29 10:52:44 -03:00

27 lines
629 B
Rust

// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::Manager;
fn main() {
let mut app = tauri::Builder::default()
.build(tauri::generate_context!(
"../../examples/run-iteration/tauri.conf.json"
))
.expect("error while building tauri application");
loop {
app.run_iteration(|_app, _event| {
//println!("{:?}", _event);
});
if app.webview_windows().is_empty() {
app.cleanup_before_exit();
break;
}
}
}