1
Fork 0
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:
Sam Atkins 2023-01-11 20:00:46 +00:00 committed by Andreas Kling
parent 6edc0cf5ab
commit e181b1cb82
12 changed files with 37 additions and 51 deletions

View file

@ -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");