mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it into a Core::Object allows anyone who needs it to extends its lifetime.
This commit is contained in:
parent
0d577ab781
commit
1dd1595043
51 changed files with 140 additions and 138 deletions
|
@ -33,7 +33,7 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GUI::Application app(argc, argv);
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_rect(100, 100, 240, 160);
|
||||
|
@ -53,10 +53,10 @@ int main(int argc, char** argv)
|
|||
button.set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
|
||||
button.set_preferred_size(0, 20);
|
||||
button.on_click = [&](auto) {
|
||||
app.quit();
|
||||
app->quit();
|
||||
};
|
||||
|
||||
window->show();
|
||||
|
||||
return app.exec();
|
||||
return app->exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue