mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:57:45 +00:00
Userland: Use Core::Timer::create_foo() factory functions where possible
This commit is contained in:
parent
6edc0cf5ab
commit
e181b1cb82
12 changed files with 37 additions and 51 deletions
|
@ -47,10 +47,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->resize(840, 600);
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
|
||||
auto main_widget_updater = Core::Timer::construct(static_cast<int>((1 / 30.0) * 1000), [&] {
|
||||
auto main_widget_updater = TRY(Core::Timer::create_repeating(static_cast<int>((1 / 30.0) * 1000), [&] {
|
||||
if (window->is_active())
|
||||
Core::EventLoop::current().post_event(main_widget, make<Core::CustomEvent>(0));
|
||||
});
|
||||
}));
|
||||
main_widget_updater->start();
|
||||
|
||||
auto& file_menu = window->add_menu("&File");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue