mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 22:54:36 +00:00
18 lines
569 B
Rust
18 lines
569 B
Rust
// Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
// SPDX-License-Identifier: MIT
|
|
use slint::{Timer, TimerMode};
|
|
|
|
slint::slint!(import { MainWindow } from "timer.slint";);
|
|
|
|
pub fn main() {
|
|
let main_window = MainWindow::new().unwrap();
|
|
let timer = Timer::default();
|
|
{
|
|
let main_window_weak = main_window.as_weak();
|
|
timer.start(TimerMode::Repeated, std::time::Duration::from_millis(10), move || {
|
|
let main_window = main_window_weak.unwrap();
|
|
main_window.invoke_tick(10);
|
|
});
|
|
}
|
|
main_window.run().unwrap();
|
|
}
|