mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
weather-demo: initial commit
This commit is contained in:
parent
dacc57648b
commit
33c84b67b4
51 changed files with 3924 additions and 0 deletions
30
examples/weather-demo/src/main.rs
Normal file
30
examples/weather-demo/src/main.rs
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#![cfg(any(target_os = "linux", target_os = "windows", target_os = "macos"))]
|
||||
|
||||
use crate::app_main::AppHandler;
|
||||
|
||||
pub mod ui {
|
||||
slint::include_modules!();
|
||||
}
|
||||
|
||||
mod app_main;
|
||||
mod weather;
|
||||
|
||||
fn main() -> Result<(), slint::PlatformError> {
|
||||
env_logger::Builder::default()
|
||||
.filter_level(if cfg!(debug_assertions) {
|
||||
log::LevelFilter::Debug
|
||||
} else {
|
||||
log::LevelFilter::Info
|
||||
})
|
||||
.init();
|
||||
|
||||
let mut app_handler = AppHandler::new();
|
||||
app_handler.initialize_ui();
|
||||
|
||||
let res = app_handler.run();
|
||||
app_handler.save();
|
||||
res
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue