summaryrefslogtreecommitdiff
path: root/Applications/HexEditor
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-04 09:46:23 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-04 14:26:16 +0100
commit0f3e57a6fb037f6a8133e8ec2be8f0889ff9bc19 (patch)
tree3fc1f6f91d7e00783792e98bd23f226e591d99a3 /Applications/HexEditor
parent4697195645a4c66930761c85685f5752dc777bba (diff)
downloadserenity-0f3e57a6fb037f6a8133e8ec2be8f0889ff9bc19.zip
LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clients
Diffstat (limited to 'Applications/HexEditor')
-rw-r--r--Applications/HexEditor/main.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Applications/HexEditor/main.cpp b/Applications/HexEditor/main.cpp
index ad5d44cef6..f20ade72e5 100644
--- a/Applications/HexEditor/main.cpp
+++ b/Applications/HexEditor/main.cpp
@@ -46,11 +46,10 @@ int main(int argc, char** argv)
window->set_title("Hex Editor");
window->set_rect(20, 200, 640, 400);
- auto hex_editor_widget = HexEditorWidget::construct();
- window->set_main_widget(hex_editor_widget);
+ auto& hex_editor_widget = window->set_main_widget<HexEditorWidget>();
window->on_close_request = [&]() -> GUI::Window::CloseRequestDecision {
- if (hex_editor_widget->request_close())
+ if (hex_editor_widget.request_close())
return GUI::Window::CloseRequestDecision::Close;
return GUI::Window::CloseRequestDecision::StayOpen;
};
@@ -59,7 +58,7 @@ int main(int argc, char** argv)
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-hexeditor.png"));
if (argc >= 2)
- hex_editor_widget->open_file(argv[1]);
+ hex_editor_widget.open_file(argv[1]);
return app.exec();
}