Initial commit
This commit is contained in:
commit
8cec608e21
8 changed files with 137 additions and 0 deletions
22
src/main.rs
Normal file
22
src/main.rs
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Prevent console window in addition to Slint window in Windows release builds when, e.g., starting the app via file manager. Ignored on other platforms.
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
use std::error::Error;
|
||||
|
||||
slint::include_modules!();
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let ui = AppWindow::new()?;
|
||||
|
||||
ui.on_request_increase_value({
|
||||
let ui_handle = ui.as_weak();
|
||||
move || {
|
||||
let ui = ui_handle.unwrap();
|
||||
ui.set_counter(ui.get_counter() + 1);
|
||||
}
|
||||
});
|
||||
|
||||
ui.run()?;
|
||||
|
||||
Ok(())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue