-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
877934f
commit e35bbd3
Showing
3 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright © SixtyFPS GmbH <info@slint-ui.com> | ||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial | ||
use slint::{Timer, TimerMode}; | ||
|
||
slint::slint!(import { MainWindow } from "timer.slint";); | ||
|
||
pub fn main() { | ||
let main_window = MainWindow::new(); | ||
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(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters